public void Should_support_delegate_registration()
        {
            var builder = new ContainerBuilder();

            builder.RegisterCodeSwitchEnabled<UseClassAv2>();

            builder.RegisterSwitched<UseClassAv2, A>(context => new ClassA_V2(), context => new ClassA());

            IContainer container = builder.Build();

            var a = container.Resolve<A>();

            Assert.IsInstanceOf<ClassA_V2>(a);
        }
        public void Should_use_the_new_methods()
        {
            var builder = new ContainerBuilder();

            builder.RegisterCodeSwitchEnabled<UseNewMethod>();

            builder.RegisterType<ConditionalClass>();

            var container = builder.Build();

            var conditionalClass = container.Resolve<ConditionalClass>();

            Assert.AreEqual("V2: 42, Test", conditionalClass.FunctionCall(42, "Test"));
        }
        public void Should_return_new_registration_by_type()
        {
            var builder = new ContainerBuilder();

            builder.RegisterCodeSwitchEnabled<UseClassAv2>();

            builder.RegisterSwitchedType<UseClassAv2, A, ClassA_V2, ClassA>();

            IContainer container = builder.Build();

            var a = container.Resolve<A>();

            Assert.IsInstanceOf<ClassA_V2>(a);
        }
        public void Should_return_as_specific()
        {
            var builder = new ContainerBuilder();

            builder.CodeSwitchesDisabledbyDefault();

            builder.RegisterCodeSwitchEnabled<Active>();

            IContainer container = builder.Build();

            var fooId = container.Resolve<ICodeSwitch<Active>>();

            Assert.IsTrue(fooId.Enabled);
        }