public void CheckExtensionAdded()
        {
            MyCustomExtension extension = new MyCustomExtension();
            IUnityContainer uc = new UnityContainer();
            uc.AddExtension(extension);

            Assert.IsTrue(extension.CheckExtensionValue);
        }
        public void CheckExtensionAddedToContainer()
        {
            MyCustomExtension extension = new MyCustomExtension();
            IUnityContainer uc = new UnityContainer();
            uc.AddExtension(extension);

            Assert.AreSame(uc, extension.Container);
        }
        public void CheckExtensionAdded()
        {
            MyCustomExtension extension = new MyCustomExtension();
            IUnityContainer   uc        = new UnityContainer();

            uc.AddExtension(extension);

            Assert.IsTrue(extension.CheckExtensionValue);
        }
        public void CheckExtensionAddedToContainer()
        {
            MyCustomExtension extension = new MyCustomExtension();
            IUnityContainer   uc        = new UnityContainer();

            uc.AddExtension(extension);

            Assert.AreSame(uc, extension.Container);
        }
        public void AddExistingMyCustonExtensionToContainer()
        {
            MyCustomExtension extension = new MyCustomExtension();
            IUnityContainer uc = new UnityContainer();
            uc.AddExtension(extension);

            Assert.IsNotNull(uc);
            Assert.IsTrue(extension.CheckPolicyValue);
        }
        public void AddExistingMyCustonExtensionToContainer()
        {
            MyCustomExtension extension = new MyCustomExtension();
            IUnityContainer   uc        = new UnityContainer();

            uc.AddExtension(extension);

            Assert.IsNotNull(uc);
            Assert.IsTrue(extension.CheckPolicyValue);
        }
        public void ConfigureToContainer()
        {
            MyCustomExtension extension = new MyCustomExtension();

            IUnityContainer container = new UnityContainer()
                                        .AddExtension(extension);

            IMyCustomConfigurator extend = container.Configure <IMyCustomConfigurator>();

            Assert.AreSame(extension.Container, extend.Container);
        }
        public void AddExtensionGetObject()
        {
            MyCustomExtension extension = new MyCustomExtension();

            IUnityContainer container = new UnityContainer()
                                        .AddExtension(extension);

            object result = container.Resolve <object>();

            Assert.IsNotNull(result);
        }
        public void AddExistExtensionAddPolicyAddConfigurator()
        {
            MyCustomExtension extension = new MyCustomExtension();
            IUnityContainer   container = new UnityContainer()
                                          .AddExtension(extension)
                                          .Configure <IMyCustomConfigurator>()
                                          .AddPolicy().Container;

            Assert.IsNotNull(container);
            Assert.IsTrue(extension.CheckPolicyValue);
        }
        public void AddExtensionGetObject()
        {
            MyCustomExtension extension = new MyCustomExtension();

            IUnityContainer container = new UnityContainer()
                .AddExtension(extension);

            object result = container.Resolve<object>();

            Assert.IsNotNull(result);
        }
        public void AddExtensionSetLifetime()
        {
            MyCustomExtension extension = new MyCustomExtension();
            IUnityContainer   container = new UnityContainer()
                                          .AddExtension(extension);

            container.RegisterInstance <MyCustomExtension>(extension);
            object result = container.Resolve <object>();

            Assert.IsNotNull(result);
            Assert.IsNotNull(container);
        }
        public void ConfigureToContainer()
        {
            MyCustomExtension extension = new MyCustomExtension();

            IUnityContainer container = new UnityContainer()
                .AddExtension(extension);

            IMyCustomConfigurator extend = container.Configure<IMyCustomConfigurator>();

            Assert.AreSame(extension.Container, extend.Container);
        }
        public void AddExtensionSetLifetime()
        {
            MyCustomExtension extension = new MyCustomExtension();
            IUnityContainer container = new UnityContainer()
                 .AddExtension(extension);

            container.RegisterInstance<MyCustomExtension>(extension);
            object result = container.Resolve<object>();
            
            Assert.IsNotNull(result);
            Assert.IsNotNull(container);
        }
        public void AddExistExtensionAddPolicyAddConfigurator()
        {
            MyCustomExtension extension = new MyCustomExtension();
            IUnityContainer container = new UnityContainer()
                 .AddExtension(extension)
                 .Configure<IMyCustomConfigurator>()
                     .AddPolicy().Container;

            Assert.IsNotNull(container);
            Assert.IsTrue(extension.CheckPolicyValue);
        }