public void CompoundServiceInstantiationTest() { IServiceCollection serviceCollection = new ServiceCollection(); IServiceLocator uut = DependencyInjectionServiceLocator.Initialize(serviceCollection); Assert.IsNotNull(uut); Assert.IsInstanceOfType(uut, typeof(DependencyInjectionServiceLocator)); object item = uut.GetInstance <ICompoundService>(); Assert.IsNotNull(item); Assert.IsInstanceOfType(item, typeof(ICompoundService)); Assert.IsInstanceOfType(item, typeof(CompoundServiceImpl)); string result = ((ICompoundService)item).CompoundMethod(); Assert.IsNotNull(result); Assert.AreEqual("SUCCESS", result); result = ((ICompoundService)item).InternalServiceName(); Assert.IsNotNull(result); Assert.AreEqual(typeof(UnitTestServiceImpl).FullName, result); }
public void ServiceLocatorInialize1Test() { IServiceLocator uut = DependencyInjectionServiceLocator.Initialize(); Assert.IsNotNull(uut); Assert.IsInstanceOfType(uut, typeof(DependencyInjectionServiceLocator)); }