0.6.0 #311
nth-commit
announced in
Announcements
0.6.0
#311
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
New package:
GalaxyCheck.Xunit.CodeAnalysis
It's installed automatically when you install
GalaxyCheck.Xunit
, and will be the home of Roslyn analyzers and code refactoring providers.Add
MemberGenAttribute
This new attribute mirrors
MemberData
in xunit, but allows parameter-level configuration of data generation. It allows you to quickly configure generators without using a customGenFactory
, or switching to LINQ-properties.MemberGenAttribute
is optional on parameters. If omitted, it will fall back to the default generation strategy.Add Roslyn analyzers for statically checking the validity of a
MemberGenAttribute
IGen<T>
, whereT
is the parameter type the attribute is decorating)Add Roslyn code-refactoring provider for generating
MemberGenAttributes
The code refactor will interpret the type of parameter that the cursor is over, and produce a generator inside the class that'll provide a good starting point for further configuration.
Improves
Property.Precondition
Property.Precondition
is a quick and dirty way to filter input to a property that you can add inside it's body. It's similar toGen.Where
, but it has a few limitations. However, a lot of the time, it's just what you need.For example, consider the property:
This property will almost certainly fail, as early on in testing a property, GalaxyCheck has a high chance of generating the minimum value (e.g.
0
), and later on, it has a reasonably chance of generating the maximum value (e.g.int.MaxValue
). This makes the test pretty flakey. One way to fix that is to couple the generation of the integers together, like so:This is reasonably verbose.
Property.Precondition
allows you augment the existing test slightly to provide that filter, rather than modifying the whole generation:This release improves
Property.Precondition
so it behaves slightly more likeGen.Where
. Whilst some of the limitations between it andGen.Where
are impossible to resolve (mostly, because GalaxyCheck has no insight into what and why the values are filtered), it improves the usability a fair bit, such that:x > 0
.BREAKING: Simplified some of the information returned by
Property.Check
This change has a very low-chance of being breaking in reality, but some of the properties on the
CheckResult
were trimmed down, somewhat.This discussion was created from the release 0.6.0.
Beta Was this translation helpful? Give feedback.
All reactions