I am using Unity for IOC. I would like to configure the creation of moq objects using the app.config. My config looks some like this:
<unity xmlns="schemas.microsoft.com/practices/2010/unity">
<container>
<register type="Namespace1.IFoo, FooInterface"
mapTo="Namespace2.FooImp, FooImplementation">
</register>
</container>
</unity>
I am looking for a technique to specify a configuration some like this:
<unity xmlns="schemas.microsoft.com/practices/2010/unity">
<container>
<register type="Namespace1.IFoo, FooInterface"
mapTo="Moq.Mock<IFoo>, Moq">
</register>
</container>
</unity>
I Know that I have to access .Object property of a Mock but this sample is just meant to explain what I want to do.
In other words: I do not want to use code to configure unity to use moq. An option would of course be to create some helpers that can be used in general.
After no one could help I figured something out.
Use a Factory for moq and add a factory resolution via unity
sample goes here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With