public void GetAllInstanceJustReturnsCollectionOfWithOnylOneResolvedInstanceOfNonRegisteredNonAbstractClasses()
 {
     var serviceLocator = new ServiceLocator();
     var serviceLocatorAdapter = new ServiceLocatorAdapter(serviceLocator);
     FooNonAbstractClass[] list = serviceLocatorAdapter.GetAllInstances<FooNonAbstractClass>().ToArray();
     Assert.AreEqual(1, list.Length);
 }
 public void GetAllInstanceJustReturnsEmptyCollectionIfTheTypeIsNonRegistered()
 {
     var serviceLocator = new ServiceLocator();
     var serviceLocatorAdapter = new ServiceLocatorAdapter(serviceLocator);
     IFooInterface[] list = serviceLocatorAdapter.GetAllInstances<IFooInterface>().ToArray();
     Assert.AreEqual(0, list.Length);
 }
Exemple #3
0
        public void GetAllInstanceJustReturnsCollectionOfWithOnylOneResolvedInstanceOfNonRegisteredNonAbstractClasses()
        {
            var serviceLocator        = IoCFactory.CreateServiceLocator();
            var serviceLocatorAdapter = new ServiceLocatorAdapter(serviceLocator);

            FooNonAbstractClass[] list = serviceLocatorAdapter.GetAllInstances <FooNonAbstractClass>().ToArray();
            Assert.AreEqual(1, list.Length);
        }
Exemple #4
0
        public void GetAllInstanceJustReturnsEmptyCollectionIfTheTypeIsNonRegistered()
        {
            var serviceLocator        = IoCFactory.CreateServiceLocator();
            var serviceLocatorAdapter = new ServiceLocatorAdapter(serviceLocator);

            IFooInterface[] list = serviceLocatorAdapter.GetAllInstances <IFooInterface>().ToArray();
            Assert.AreEqual(0, list.Length);
        }
 public void GetAllInstanceJustReturnsCollectionOfWithOnylOneResolvedInstanceIfTheTypeIsRegistered()
 {
     var serviceLocator = new ServiceLocator();
     serviceLocator.RegisterType<IFooInterface, FooNonAbstractClass>();
     var serviceLocatorAdapter = new ServiceLocatorAdapter(serviceLocator);
     IFooInterface[] list = serviceLocatorAdapter.GetAllInstances<IFooInterface>().ToArray();
     Assert.AreEqual(1, list.Length);
 }
Exemple #6
0
        public void GetAllInstanceJustReturnsCollectionOfWithOnylOneResolvedInstanceIfTheTypeIsRegistered()
        {
            var serviceLocator = IoCFactory.CreateServiceLocator();

            serviceLocator.RegisterType <IFooInterface, FooNonAbstractClass>();
            var serviceLocatorAdapter = new ServiceLocatorAdapter(serviceLocator);

            IFooInterface[] list = serviceLocatorAdapter.GetAllInstances <IFooInterface>().ToArray();
            Assert.AreEqual(1, list.Length);
        }