Closed logiclrd closed 4 years ago
Okay I was too quick on the trigger with that, a bunch of unit tests now fail with this change and it appears to be because the testing infrastructure cannot abide a primitive set to its default value, and the version's .MajorRevision
has value 0 == default(short)
. Hmm...
In our project, we naively pointed AutoBogus at a type containing a
Version
property, and the resultingVersion
object was initialized in an odd way, withBuild
andRevision
set to -1 and no bogus data inMajor
orMinor
. This PR adds a defaultVersionGenerator
to AutoBogus so thatVersion
objects are generated with valid (non-negative) random integers in all properties.A unit test verifies the new functionality.