Esempio n. 1
0
        public void CreateInstance_InnerContainerParamIsPresent()
        {
            var instance = DependencyContainerFactory.CreateInstance <Container>(
                new Container());

            Assert.NotNull(instance);
        }
Esempio n. 2
0
 public void CreateInstance_ContainerDoesNotImplementBaseClass_ThrowsNonDependencyContainerException()
 {
     Assert.Throws <NonDependencyContainerException>(() =>
     {
         DependencyContainerFactory.CreateInstance <BaselessContainer>(
             new BaselessContainer());
     });
 }
Esempio n. 3
0
 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);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
 private IDependencyContainer GetDependencyContainer(DependencyContainerFactory dependencyContainerFactory)
 {
     ArgumentChecker.IsNotNull(dependencyContainerFactory, "resolverFactory");
     return(dependencyContainerFactory.CreateInstance());
 }