public TestResponse TestProcessor(TestRequest testRequest) { ITest test = IocFactory.ResolveByName <ITest>(testRequest.TestId); TestResponse response = new TestResponse(); return(test.Execute(testRequest)); }
public void IocFactory_MultipleComponentsForSameInterface_Test() { IocFactory.Register(Component.For <IPerson>().ImplementedBy <Pedro>("P")); IocFactory.Register(Component.For <IPerson>().ImplementedBy <Odilon>("O")); IocFactory.Register(Component.For <IPerson>().ImplementedBy <Guilherme>("G")); IPerson person = IocFactory.ResolveByName <IPerson>("O"); Assert.IsNotNull(person); Assert.IsInstanceOfType(person, typeof(Odilon)); }
public void IocFactory_ResolvedNamed_Test() { IocFactory.Register( Component.For <IConfigurationUtilityMock>() .ImplementedBy <ConfigurationUtilityMock>() .ImplementedBy <AnotherMock>("Another") ); IConfigurationUtilityMock mock = IocFactory.ResolveByName <IConfigurationUtilityMock>("Another"); Assert.IsNotNull(mock); Assert.IsInstanceOfType(mock, typeof(AnotherMock)); }