Ejemplo n.º 1
0
        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_DoesNot_Resolve_NonRegistered_ContactRepository_Test()
        {
            using (var container = new WindsorContainer())
            {
                var resolver = new WindsorResolver(container);
                var instance = resolver.GetService(typeof (IContactRepository));

                Assert.IsNull(instance);
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }
        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);
            }
        }