When using AutoFixture you allways have to create a new instance of the Fixture class...
Fixture fixture = new Fixture();
Get a string of fixed length
When using AutoFixture to fillout string properties, the default behavior is to join the name of the property with a Guid. But sometimes you have to use some fixed size strings - to achieve this you can use the following code:
var stringOfSize10 = string.Join(string.Empty, fixture.CreateMany<char>(10));
Note: It seems that some of my earlier findings have been corrected in a later version of AutoFixture and has therefore been removed from the list ...
var stringOfSize10 = string.Join(string.Empty, fixture.CreateMany<char>(10));
Note: It seems that some of my earlier findings have been corrected in a later version of AutoFixture and has therefore been removed from the list ...
No comments:
Post a Comment