Is it possible to either create an object by type, for example:
Type typeToCreate = typeof(TestModel);
Fixture fixture = new Fixture();
var item = fixture.Create(typeToCreate)
Or something where I can pass an already created object and it is filled, for example:
fixture.Fill(myAlreadyCreatedObject);
I could only manage to create items by generics, like fixture.Create<MyType>()
. This works fine, but generics sometimes limit you if the type is determined at runtime.