Git Product home page Git Product logo

Comments (4)

bartelink avatar bartelink commented on May 23, 2024

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.

spingee avatar spingee commented on May 23, 2024

There is really no way how to do it per test class?

from fscheck.

bartelink avatar bartelink commented on May 23, 2024

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.

spingee avatar spingee commented on May 23, 2024

Properties attribute on test class works, thank you very much

from fscheck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.