moq - Autofixture: Using AutoMoqCustomization & SetupAllProperties to have all properties of a mocked interface fillled? -
i trying autofixture setup , create me anonymous of interface. using automoqcustomization, keep getting error.
my code is
var configuration = fixture.createanonymous<mock<iconfiguration>>(); mock.get(configuration).setupallproperties();
it errors on setupallproperties
with
system.argumentexception : object instance not created moq. parameter name: mocked
anyone know doing wrong?
you're trying mock<iconfiguration>
mock<iconfiguration>
instance, hardly necessary. use
var configuration = fixture.createanonymous<mock<iconfiguration>>(); configuration.setupallproperties();
Comments
Post a Comment