public void should_be_able_to_inject_dependency() { var c = new Container(); c.EasyRegister<IFoo, Foo>(); c.EasyRegister<IBar, Bar>(); var bar = c.Resolve<IBar>() as Bar; Assert.IsNotNull(bar.Foo); }
public void should_be_able_to_chain_dependencies() { var c = new Container(); var testFoo = new Foo(); c.Register<IFoo>(testFoo); c.EasyRegister<IBar, Bar>(); c.EasyRegister<IBaz, Baz>(); var baz = c.Resolve<IBaz>() as Baz; var bar = baz.Bar as Bar; Assert.AreSame(bar.Foo, testFoo); }
public void should_be_able_to_get_service_impl() { var c = new Container(); c.EasyRegister<IFoo, Foo>(); Assert.IsInstanceOf<Foo>(c.Resolve<IFoo>()); }
public void should_be_able_to_get_service_impl() { var c = new Container(); c.EasyRegister<IFoo, Foo>(); c.Resolve<IFoo>().GetType().ShouldEqual(typeof(Foo)); }