How do I force AutoFixture, that has been configured with AutoConfiguredMoqCustomization, to automatically mock interfaces and its read-only properties?
To make things clear, let's assume I have such an interface:
public interface A {
int Property {get;}
}
and such class:
public class SomeClass {
public SomeClass(A dependency) {}
}
What I want is to have dependency
resolved to a mock that will return something in dependency.Property
:
var fixture = new Fixture().Customize(new AutoConfiguredMoqCustomization());
var sut = fixture.Create<SomeClass>(); // <- dependency passed to SomeClass' constructor will have .Property returning null
4.1.1308.2120
instead:install-package Moq -version 4.1.1308.2120
. – Peccadillo