Ejemplo n.º 1
0
        public void it_checks_is_in_case_insensitive()
        {
            var env = AppEnv.In("A");

            env.IsIn("a").ShouldBeTrue();
            env.IsIn("b").ShouldBeFalse();
        }
Ejemplo n.º 2
0
        public void it_checks_is_in_correctly()
        {
            var env = AppEnv.In("A");

            env.IsIn("A").ShouldBeTrue();
            env.IsIn("B").ShouldBeFalse();
        }
Ejemplo n.º 3
0
        public void it_checks_complex_scenario_1()
        {
            var qa = AppEnv.In("qa");

            qa.IsIn("qa").ShouldBeTrue();

            var local = AppEnv.In("development") + AppEnv.In("test") + AppEnv.In("other-dev");

            local.IsIn("development").ShouldBeTrue();
            local.IsIn("test").ShouldBeTrue();
            local.IsIn("other-dev").ShouldBeTrue();
            local.IsIn("production").ShouldBeFalse();

            var deployed = !local;

            deployed.IsIn("development").ShouldBeFalse();
            deployed.IsIn("test").ShouldBeFalse();
            deployed.IsIn("other-dev").ShouldBeFalse();
            deployed.IsIn("production").ShouldBeTrue();

            var insideOtherNetwork = AppEnv.In("other-dev") + AppEnv.In("production") + AppEnv.In("other-qa");

            var deployedInsideOtherNetwork = insideOtherNetwork * deployed;

            deployedInsideOtherNetwork.IsIn("production").ShouldBeTrue();
            deployedInsideOtherNetwork.IsIn("other-qa").ShouldBeTrue();
            deployedInsideOtherNetwork.IsIn("other-dev").ShouldBeFalse();

            var notDeployedInOtherNetwork = !deployedInsideOtherNetwork;

            notDeployedInOtherNetwork.IsIn("qa").ShouldBeTrue();
        }
Ejemplo n.º 4
0
        public void minus_operator_works()
        {
            var actual = AppEnv.In("A", "B", "C") - AppEnv.In("B", "D");

            actual.IsIn("A").ShouldBeTrue();
            actual.IsIn("B").ShouldBeFalse();
            actual.IsIn("C").ShouldBeTrue();
            actual.IsIn("D").ShouldBeFalse();
        }
Ejemplo n.º 5
0
        public void intersects_works()
        {
            var actual = AppEnv.In("A", "B", "C") * AppEnv.In("B", "D");

            actual.IsIn("A").ShouldBeFalse();
            actual.IsIn("B").ShouldBeTrue();
            actual.IsIn("C").ShouldBeFalse();
            actual.IsIn("D").ShouldBeFalse();
        }
Ejemplo n.º 6
0
        public void plus_operator_works()
        {
            var env1 = AppEnv.In("A");
            var env2 = AppEnv.In("B");

            (env1 + env2).IsIn("A").ShouldBeTrue();
            (env1 + env2).IsIn("B").ShouldBeTrue();
            (env1 + env2).IsIn("C").ShouldBeFalse();
        }