public void CreateInstance_InnerContainerParamIsPresent() { var instance = DependencyContainerFactory.CreateInstance <Container>( new Container()); Assert.NotNull(instance); }
public void CreateInstance_ContainerDoesNotImplementBaseClass_ThrowsNonDependencyContainerException() { Assert.Throws <NonDependencyContainerException>(() => { DependencyContainerFactory.CreateInstance <BaselessContainer>( new BaselessContainer()); }); }
public void CreateInstance_InnerContainerParamIsNull_ThrowsArgumentNullException() { Assert.Throws <ArgumentNullException>(() => { DependencyContainerFactory.CreateInstance <Container>( null); }); }
public static IDependencyContainer CreateInstance( bool allowReflectionEmit = false) { var instance = DependencyContainerFactory.CreateInstance <DryContainer>( CreateImplementation(allowReflectionEmit)); return(instance); }
public static IDependencyContainer CreateInstance( ILogService logService, bool allowReflectionEmit = false) { var instance = DependencyContainerFactory.CreateInstance <NinjectDependencyContainer>( CreateImplementation(allowReflectionEmit), logService); return(instance); }
public void CreateInstance_InnerContainerAndLogServiceParamIsPresent() { LogServiceFactory.Instance.AddConsole(); var instance = DependencyContainerFactory.CreateInstance <Container>( new Container(), LogServiceFactory.Instance.Create("unit test")); Assert.NotNull(instance); Assert.NotNull((instance as Container).Log); }
private IDependencyContainer GetDependencyContainer(DependencyContainerFactory dependencyContainerFactory) { ArgumentChecker.IsNotNull(dependencyContainerFactory, "resolverFactory"); return(dependencyContainerFactory.CreateInstance()); }