My issue is, cannot create auto generated instance from the interface.
Here is my example:
public class SomeClass {
public string TestName { get; set; }
}
// And then I call like this
var obj = new Fixture().Create<SomeClass>();
Concrete class is generated automatically and it's properties like this:
Console.WriteLine(obj.TestName);
// Output: TestNameb7c3f872-9286-419f-bb0a-c4b0194b6bc8
But I have an interface like below:
public interface ISomeInterface
{
string TestName { get; set; }
}
// And then I call like this
var obj = new Fixture().Create<ISomeInterface >();
It is generated but it's properties is not set.
Console.WriteLine(obj.TestName);
// Output: null
How can I create an instance from the interface like the concrete class?