Sometimes it's useful to be able to provide a value to be used during generation but you don't know what the name of the parameter or property is that you want to provide.
If a constraint has an IEnumerable property called _Values then these values will be used during location, population, and generation.
var someClass = new SomeClass { IntValue = 50, StringValue = "Test" };
var instance = fixture.Generate(constraints: new { _Values = new[] { someClass } });
Assert.Same(someClass, instance.SomeClass);
Sometimes it's useful to be able to provide a value to be used during generation but you don't know what the name of the parameter or property is that you want to provide.
If a constraint has an IEnumerable property called _Values then these values will be used during location, population, and generation.
var someClass = new SomeClass { IntValue = 50, StringValue = "Test" }; var instance = fixture.Generate(constraints: new { _Values = new[] { someClass } });
Assert.Same(someClass, instance.SomeClass);