public void TestRegister() { var container = new SimpleInjectorAdapter(); container.Register<IFoo, Foo>(); //container.Has<IFoo>(); container.Verify(); }
public void TestGetInstance() { var container = new SimpleInjectorAdapter(); container.Register<IFoo, Foo>(); IFoo foo = container.GetInstance<IFoo>(); Assert.NotNull(foo); Assert.IsType<Foo>(foo); }
public void TestGetInstanceCheckForInstanceIdentity() { var container = new SimpleInjectorAdapter(); container.Register<IFoo, Foo>(); IFoo foo1 = container.GetInstance<IFoo>(); Assert.NotNull(foo1); Assert.IsType<Foo>(foo1); IFoo foo2 = container.GetInstance<IFoo>(); Assert.NotNull(foo2); Assert.IsType<Foo>(foo2); Assert.Same(foo1, foo2); }