コード例 #1
0
        public void CreateInstance_InnerContainerParamIsPresent()
        {
            var instance = DependencyContainerFactory.CreateInstance <Container>(
                new Container());

            Assert.NotNull(instance);
        }
コード例 #2
0
 public void CreateInstance_ContainerDoesNotImplementBaseClass_ThrowsNonDependencyContainerException()
 {
     Assert.Throws <NonDependencyContainerException>(() =>
     {
         DependencyContainerFactory.CreateInstance <BaselessContainer>(
             new BaselessContainer());
     });
 }
コード例 #3
0
 public void CreateInstance_InnerContainerParamIsNull_ThrowsArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() =>
     {
         DependencyContainerFactory.CreateInstance <Container>(
             null);
     });
 }
コード例 #4
0
        public static IDependencyContainer CreateInstance(
            bool allowReflectionEmit = false)
        {
            var instance = DependencyContainerFactory.CreateInstance <DryContainer>(
                CreateImplementation(allowReflectionEmit));

            return(instance);
        }
コード例 #5
0
        public static IDependencyContainer CreateInstance(
            ILogService logService,
            bool allowReflectionEmit = false)
        {
            var instance = DependencyContainerFactory.CreateInstance <NinjectDependencyContainer>(
                CreateImplementation(allowReflectionEmit),
                logService);

            return(instance);
        }
コード例 #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);
        }
コード例 #7
0
ファイル: DefaultEngine.cs プロジェクト: Connor-MXJ/Template
 private IDependencyContainer GetDependencyContainer(DependencyContainerFactory dependencyContainerFactory)
 {
     ArgumentChecker.IsNotNull(dependencyContainerFactory, "resolverFactory");
     return(dependencyContainerFactory.CreateInstance());
 }