I know I can use AutoFixture to create an auto-mocked instance using
var person = fixture.Create<Person>();
But, if I want to customise the way a Person
is created I have several options. One is to use Build
var person = fixture.Build<Person>()
.With(x => x.FirstName, "Owain")
.Create();
And another is to use Customize
fixture.Customize<Person>(c => c.With(x => x.FirstName, "Owain"));
var person = fixture.Create<Person>();
So, my question is, what are the various merits and pitfalls of each approach listed above, and are there any other / better approaches?