public void LoadTypeMappingsNullEmuneration_Test() { ActivatingServiceLocatorFactory factory = new ActivatingServiceLocatorFactory(); IServiceLocator servicelocator = factory.Create(); factory.LoadTypeMappings(servicelocator, null); }
public void ServiceLocatorFactory_CreateTest() { ActivatingServiceLocatorFactory factory = new ActivatingServiceLocatorFactory(); IServiceLocator servicelocator = factory.Create(); Assert.AreEqual(servicelocator.GetType().ToString(), typeof(ActivatingServiceLocator).ToString(), "ActivatingServiceLocatorFactory create method failed to craete an object of type ActivatingServiceLocator"); }
public void FactoryCreatesServiceLocator() { var target = new ActivatingServiceLocatorFactory(); ActivatingServiceLocator serviceLocator = target.Create() as ActivatingServiceLocator; Assert.IsNotNull(serviceLocator); }
public void LoadTypeMappings3_Test() { ActivatingServiceLocatorFactory factory = new ActivatingServiceLocatorFactory(); IServiceLocator servicelocator = factory.Create(); List <TypeMapping> typeMappings = new List <TypeMapping>(); typeMappings.Add(new TypeMapping()); factory.LoadTypeMappings(servicelocator, typeMappings); }
public void FactoryCreatesServiceLocator() { //Arrange var target = new ActivatingServiceLocatorFactory(); //Act var serviceLocator = target.Create() as ActivatingServiceLocator; //Assert Assert.IsNotNull(serviceLocator); }
public void LoadTypeMappings2_Test() { ActivatingServiceLocatorFactory factory = new ActivatingServiceLocatorFactory(); IServiceLocator servicelocator = factory.Create(); List <TypeMapping> typeMappings = new List <TypeMapping>(); typeMappings.Add(new TypeMapping(typeof(IInterface1), typeof(FirstClass1), null)); factory.LoadTypeMappings(servicelocator, typeMappings); ActivatingServiceLocator AserviceLoc = servicelocator as ActivatingServiceLocator; Assert.IsTrue(AserviceLoc.IsTypeRegistered <IInterface1>(), "Failed to register the type"); object FirstClass1Object = AserviceLoc.GetInstance(typeof(IInterface1)); Assert.AreEqual(FirstClass1Object.GetType().Name, "FirstClass1"); }