public void ResolveMocksByName_ImplicitMocksCreated() { var container = new UnityContainer(); container.EnableMocking(); var fatal = container.Resolve <ILogger>("fatal"); var trace = container.Resolve <ILogger>("trace"); Assert.AreNotSame(fatal, trace); }
public void ResolveMocksWithoutRegistration_ImplicitMocksCreated() { var container = new UnityContainer(); container.EnableMocking(); var greeter = container.RegisterType <Greeter>().Resolve <Greeter>(); greeter.Greet(); var logger = container.Resolve <ILogger>(); Mock.Assert(() => logger.Log("0: "), Occurs.Once()); }
public void SetUp() { Container = new UnityContainer(); Container.EnableMocking(); DependencyInjection.Container = Container; }