public void WindsorResolver_DoesNot_Resolve_NonRegistered_ContactRepository_Test() { using (var container = new WindsorContainer()) { var resolver = new WindsorResolver(container); var instance = resolver.GetService(typeof (IContactRepository)); Assert.IsNull(instance); } }
public void WindsorResolver_Resolves_Registered_ContactRepository_Test() { using (var container = new WindsorContainer()) { container.Register( Component.For<IContactRepository>().Instance(new InMemoryContactRepository())); var resolver = new WindsorResolver(container); var instance = resolver.GetService(typeof (IContactRepository)); Assert.IsNotNull(instance); } }