public void ValidationContext_Allows_Services_To_Explicitly_Promote_To_Parent()
        {
            MyServiceContainer container = new MyServiceContainer();
            ValidationContext  context   = new ValidationContext(this, container, null);

            MyTestService service = new MyTestService();

            context.ServiceContainer.AddService(service.GetType(), service, true); // Explicit promotion

            Assert.AreSame(service, container.GetService(service.GetType()));
        }
        public void ValidationContext_Allows_Services_To_Not_Promote_To_Parent_Container()
        {
            MyServiceContainer container = new MyServiceContainer();
            ValidationContext  context   = new ValidationContext(this, container, null);

            MyTestService service = new MyTestService();

            context.ServiceContainer.AddService(service.GetType(), service, false);

            Assert.IsNull(container.GetService(service.GetType()));
        }
        public void ValidationContext_Allows_Services_To_Explicitly_Promote_To_Parent() {
            MyServiceContainer container = new MyServiceContainer();
            ValidationContext context = new ValidationContext(this, container, null);

            MyTestService service = new MyTestService();
            context.ServiceContainer.AddService(service.GetType(), service, true); // Explicit promotion

            Assert.AreSame(service, container.GetService(service.GetType()));
        }
        public void ValidationContext_Allows_Services_To_Not_Promote_To_Parent_Container() {
            MyServiceContainer container = new MyServiceContainer();
            ValidationContext context = new ValidationContext(this, container, null);

            MyTestService service = new MyTestService();
            context.ServiceContainer.AddService(service.GetType(), service, false);

            Assert.IsNull(container.GetService(service.GetType()));
        }