I've been using Xunit.Combinatorial for a while now in a few projects, but it's always felt quite limited, and creating a new attribute every time I needed to do something even mildly interesting was getting a bit tired. I had some time on my hands, so I figured why not add some new functionality to cover some of the cases that kept cropping up for me.
Sorry they're all grouped in a single pull request, but some of them are kinda interdependent, so it was just easier to work on them all at once and push everything together.
I've also addressed two of the outstanding issues, #6 (F# discriminated unions) and #1 (member-source for parameter values)
I've tried to make the commit messages as detailed as possible as to what's been added/updated, but a quick list of new stuff:
Per-test-class overrides/specification of default values for parameter types
New parameter attribute base class that allows the more general IEnumerable over forced T[]
[AllFlags] to generate all combinations of [Flags] enum flags
[Range] to generate all values between bounds
[Member] to call static methods/properties (on the test class or other classes) for values with type checks
[Random] to generate unbiased integer random values between bounds (can specify seed for repeatability)
Nullable types generate default values
F# discriminated unions (including Option) generate all cases with default values of types of each case provided
275 new tests to cover the above
The tests for the F# discriminated unions are a tad iffy - because VS15 doesn't yet have full F# support for the new project format (it's doesn't have the SDK installed yet) the tests, and the associated project, aren't built when Visual Studio is performing a build, because it would fail otherwise. However, when built from the command line with dotnet, the F# tests are built in and tested.
I also took the liberty of updating the copyright statements at the top of files to reflect the dual-authorship, since these are some pretty extensive changes. Let me know if that's a problem.
I've been using Xunit.Combinatorial for a while now in a few projects, but it's always felt quite limited, and creating a new attribute every time I needed to do something even mildly interesting was getting a bit tired. I had some time on my hands, so I figured why not add some new functionality to cover some of the cases that kept cropping up for me.
Sorry they're all grouped in a single pull request, but some of them are kinda interdependent, so it was just easier to work on them all at once and push everything together.
I've also addressed two of the outstanding issues, #6 (F# discriminated unions) and #1 (member-source for parameter values)
I've tried to make the commit messages as detailed as possible as to what's been added/updated, but a quick list of new stuff:
The tests for the F# discriminated unions are a tad iffy - because VS15 doesn't yet have full F# support for the new project format (it's doesn't have the SDK installed yet) the tests, and the associated project, aren't built when Visual Studio is performing a build, because it would fail otherwise. However, when built from the command line with dotnet, the F# tests are built in and tested.
I also took the liberty of updating the copyright statements at the top of files to reflect the dual-authorship, since these are some pretty extensive changes. Let me know if that's a problem.