How to Mock (with Moq) Unity methods
Extension methods are not good for testing (that's described here: Mocking Extension Methods with Moq , http://www.clariusconsulting.net/blogs/kzu/archive/2009/12/22/Howtomockextensionmethods.aspx ). But probably there are some solutions for mocking of Unity methods? In my case I have the following function: public class MyManager { public MyManager(IUnityContainer container) : base(container) { } public IResult DoJob(IData data) { IMyLog log = MyContainer.Resolve<IMyLog>(); ... use log.Id ... MyContainer.Resolve<...>();//usage for other purposes... } I want to be sure that 'DoJob' method will