public void TestRegister()
        {
            var instance = new SimpleInjectorServiceContainer(new Container(), this.LogManager);

            instance.Register <IServiceContainer>(() => instance, ScopeServiceEnum.SINGLETON);
            instance.Register <ILogManager, Log4NetLogManager>();
            instance.RegisterSingleton <IEnumerable>(new List <string>());
        }
示例#2
0
        public void TestResolveType()
        {
            var instance = new SimpleInjectorServiceContainer(new Container(), this.LogManager);

            instance.Register <IServiceContainer>(() => instance, ScopeServiceEnum.Singleton);
            instance.Register <ILogManager, Log4NetLogManager>();
            instance.RegisterSingleton <IEnumerable>(new List <string>());

            Assert.IsNotNull(instance.ResolveType <IServiceContainer>());
            Assert.IsNotNull(instance.ResolveType <ILogManager>());
            Assert.IsNotNull(instance.ResolveType <IEnumerable>());
        }