Comments (4)
you can do assembly: Properties
Examples: https://github.com/search?q=repo%3Ajet%2Fdotnet-templates%20%22%5B%3Cassembly%3A%20Properties(%20Arbitrary%20%3D%22&type=code
from fscheck.
There is really no way how to do it per test class?
from fscheck.
if you are making a test class (type
, then I believe you should be able to tag that type with Properties
Something like
[<Properties(Arbitraries= [| typeof<Generators>) |]>]
type MyProps() =
let p1 = ...
member _.p2 = ...
p2 and p2 should inherit that default arbs
(I tend to try to use <PackageReference Include="FsCheck.xUnit" Version="3.0.0-beta2" />
, but some of github/jet is still on V2)
Another technique that can work well is to have a local PropertiesAttribute and/or other one that defines a 'profile', e.g.: https://github.com/jet/equinox/blob/c7c4f62048e038395bbda0768231dd3f0bf5ff14/tests/Equinox.MemoryStore.Integration/MemoryStoreIntegration.fs#L8-L14
The single best resource IME, in case you have not happened to see it is probably: https://paul.blasuc.ci/index.html
The docs are pretty all over the place on all this, sadly - if you have the time, adding some self-answered stack overflow questions might eb a good way to document this knowledge (my contribution to the world will, in due course, be for github/jet to all use FsCheck V34 and use consistent style!)
Wait, found 'the documentation' in which I found it before: https://github.com/fscheck/FsCheck/blob/master/tests/FsCheck.Test/Fscheck.XUnit/PropertyAttributeTests.fs (Was not aware tests in a module
could work that way too)
from fscheck.
Properties attribute on test class works, thank you very much
from fscheck.
Related Issues (20)
- Using `Collect` and `Classify` in conjunction with `And` or `Or` HOT 1
- Make generative collection types `IEnumerable` compatible
- Model-based testing seems to ignore command preconditions when model implementation is mutable? HOT 2
- Allow asynchronous tests to run on Task<'a> HOT 8
- xUnit analyzer emits errors on Property tests HOT 6
- NUnit question/ request? HOT 14
- Feature: In-box shortcut to obtain default generator for a type HOT 6
- XUnit tests marked with [Property] fail to run on .NET Framework HOT 3
- FsCheck not registering a static method that takes Arbitrary<TType> in C# HOT 7
- How to generate instances of more complicated data structures HOT 3
- The type 'Config' does not define the field, constructor or member 'WithArbitrary' HOT 2
- Update docs with new `Arbitrary` API based on `ArbMap` HOT 6
- feat(FsCheck.Xunit): Support xUnit >= 2.5, < 3 HOT 1
- Modelbased testing? HOT 3
- Expose `Gen.choose64` HOT 1
- feat(FsCheck.NUnit): Support NUnit >= 4.0.0 HOT 1
- Model-based testing examples in C#? HOT 2
- Check.QuickAll does not find testables that return unit HOT 2
- Prop.filter (==>) executes property even if condition does not hold HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fscheck.