Let's say I have interface:
public interface IFoo
{
int Bar1 { get; set; }
int Bar2 { get; set; }
}
If IFoo
was class, I could write:
fixture.CreateAnonymous<IFoo>();
and the result will have numbers set for Bar1
and Bar2
.
But how to do this with interface? I tried to use AutoMoqCustomization
but this seems to be for properties with interface type and not interfaces itself.
I am looking for automated way like CreateAnonymous
is for classes. Currenlty I am creating interface mock and setuping it's properties explicitly which is work I would like to save. I must missing something obvious.