Пример #1
0
        public void GetInstance_HubActivator_ReturnsLightInjectHubActivator()
        {
            var container = new ServiceContainer();
            var resolver  = new LightInjectDependencyResolver(container);

            var instance = resolver.GetService(typeof(IHubActivator));

            Assert.IsInstanceOfType(instance, typeof(LightInjectHubActivator));
        }
Пример #2
0
        public void GetInstance_HubActivator_ReturnsLightInjectHubActivator()
        {
            var container = new ServiceContainer();            
            var resolver = new LightInjectDependencyResolver(container);

            var instance = resolver.GetService(typeof(IHubActivator));

            Assert.IsInstanceOfType(instance, typeof(LightInjectHubActivator));
        }
        public void GetService_ServiceRegisteredWithContainer_ReturnsInstance()
        {
            var container = new ServiceContainer();
            container.Register<IFoo, Foo>();            
            var resolver = new LightInjectDependencyResolver(container);           
            
            var instance = resolver.GetService(typeof(IFoo));

            Assert.IsInstanceOfType(instance, typeof(IFoo));
        }
        public void GetService_ServiceRegisteredThroughAdapter_ReturnsInstance()
        {
            var container = new ServiceContainer();
            var resolver = new LightInjectDependencyResolver(container);
            resolver.Register(typeof(IFoo), () => new Foo());

            var instance = resolver.GetService(typeof(IFoo));

            Assert.IsInstanceOfType(instance, typeof(IFoo));
        }
        public void GetService_ServiceRegisteredWithContainer_ReturnsInstance()
        {
            var container = new ServiceContainer();

            container.Register <IFoo, Foo>();
            var resolver = new LightInjectDependencyResolver(container);

            var instance = resolver.GetService(typeof(IFoo));

            Assert.IsInstanceOfType(instance, typeof(IFoo));
        }
        public void GetService_ServiceRegisteredThroughAdapter_ReturnsInstance()
        {
            var container = new ServiceContainer();
            var resolver  = new LightInjectDependencyResolver(container);

            resolver.Register(typeof(IFoo), () => new Foo());

            var instance = resolver.GetService(typeof(IFoo));

            Assert.IsInstanceOfType(instance, typeof(IFoo));
        }