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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -