Can Autofixture.Create <int> return a negative value?
In fact, the following method always returns a positive integer:
var fixture = new Fixture();
var someInt = fixture.Create<int>();
Is it possible that one day the function evolves and starts to return a negative integer? Or is there an official reason why he really always returns a positive integer
If not, is there some kind of documentation hidden somewhere telling about it?
To continue using the auto object, I would like to know if there are any changes.
+4
3 answers
prgmtc , - ISpecimenBuilder.
- , RandomNumericSequenceGenerator, :
[Fact]
public void FixtureCreatesNegativeNumbers()
{
var fixture = new Fixture();
fixture.Customizations.Add(
new RandomNumericSequenceGenerator(-900, -100));
var i = fixture.Create<int>();
// Prints -> -711
var l = fixture.Create<long>();
// Prints -> 618
var f = fixture.Create<float>();
// Prints -> -78.0
}
+7