public virtual void TestCreateInjector() { TestWebAppTests.Bar bar = new TestWebAppTests.Bar(); Injector injector = WebAppTests.CreateMockInjector <TestWebAppTests.Foo>(bar); LogInstances(injector.GetInstance <HttpServletRequest>(), injector.GetInstance <HttpServletResponse >(), injector.GetInstance <HttpServletResponse>().GetWriter()); NUnit.Framework.Assert.AreSame(bar, injector.GetInstance <TestWebAppTests.Foo>()); }
public virtual void TestCreateInjector2() { TestWebAppTests.FooBar foobar = new TestWebAppTests.FooBar(); TestWebAppTests.Bar bar = new TestWebAppTests.Bar(); Injector injector = WebAppTests.CreateMockInjector <TestWebAppTests.Foo>(bar, new _AbstractModule_77(foobar)); NUnit.Framework.Assert.AreNotSame(bar, injector.GetInstance <TestWebAppTests.Bar>( )); NUnit.Framework.Assert.AreSame(foobar, injector.GetInstance <TestWebAppTests.Bar>( )); }