The SetInstance<T>(T instance) method of AutoMoqer is designed to inject specific objects. Given a constructor with parameters of the same IType the last SetInstance call will override any previous objects. This is a major flaw in the framework.
An example
A common case is for a ViewModel depending on two IScheduler's the background and the dispatcher. In your ViewModelTest you'd want to have different schedulers passed in, but this is not possible.
The
SetInstance<T>(T instance)method ofAutoMoqeris designed to inject specific objects. Given a constructor with parameters of the sameITypethe lastSetInstancecall will override any previous objects. This is a major flaw in the framework.An example
A common case is for a
ViewModeldepending on twoIScheduler's the background and the dispatcher. In yourViewModelTestyou'd want to have different schedulers passed in, but this is not possible.