-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding useful types to AutoGenConfig #59
Comments
Based on #60, I assume you're using Hedgehog from C#. I don't know how that works. The following is from an F# perspective. In any case, this repo will likely soon be merged into the main Hedgehog repo. I'll leave this decision for them. Why not just add generators like Also, I am wondering how this would help in |
No, it was F# this time ;) I'd say that in
so FSCheck can go "a la card", while in HH we'd gave to come up with a config type that adds all the necessary generators to the default config and then use it. Hence, new combination of gens -> new type required.... But it is a different story ;)
Absolutely. And this power is not taken away with adding these types. As I said, they are kind of a convenience thing, not more.. |
I thought so.
Can you create an issue about this in the GutHub repository for |
(Also feel free to unsubscribe from this thread cmeeren!) Hedgehog.Xunit pretty much forces you to separate the construction of test generators from the normal test code. My personal project's Hedgehog.fs file builds up all my domain objects and makes heavy usage of the default combinators (e.g. here). To again echo what cmereen said, adding a combinator like Here's a Hedgehog.Xunit test of mine that can serve as an example. (The testing in this repository is ugly as sin - please for the love of all that's holy don't copy what I do. I'm only using it as an example of "real world" usage.) The test generates 3 args of types
Since the domain objects are constructed elsewhere, the business tests that I write don't really need a naked "positive integer" injected into them - they mostly only ask for correct domain objects. I'm curious what circumstance you're in that necessitates the injection of something like I recognize that this comment sounds negative, but I am very willing to have my mind changed! Please don't hesitate to push back. |
Similarly to what FSCheck is doing
Can we consider adding types like:
NegativeInt
NonNegativeInt
PositiveInt
NonZeroInt
NormalFloat
NonEmptyString
StringNoNulls
NonWhiteSpaceString
XmlEncodedString
UnicodeChar
UnicodeString
Interval
IntWithMinMax
NonEmptySet
NonEmptyArray
FixedLengthArray
to
AutoGenConfig
so that they are available by default?I know that they can be defined separately and configured via
Property
attribute, but since they are very generic and very useful having them "out-of-the-box" would be extremely convenient...The text was updated successfully, but these errors were encountered: