I can get type of constructor parameter like this:
Type type = paramInfo.ParameterType;
Now I want to create stub object from this type. Is is possible? I tried with autofixture:
public TObject Stub<TObject>()
{
Fixture fixture = new Fixture();
return fixture.Create<TObject>();
}
.. but it doesn't work:
Type type = parameterInfo.ParameterType;
var obj = Stub<type>();//Compile error! ("cannot resolve symbol type")
Could you help me out?