Ejemplo n.º 1
0
        public void IsApplicable_WhenNoGatesSpecified_NoApplicableGatesReturned()
        {
            UnitTestGateContext context = new UnitTestGateContext {
                AlwaysReturnApplicable = false
            };

            GatesNone gateCombination = new GatesNone();

            Assert.True(gateCombination.IsApplicable(context, out IGate[] gates), "Get applicable gates should be true");
            Assert.Null(gates);
        }
Ejemplo n.º 2
0
        public void IsApplicable_WithOneNotApplicable_ReturnsSuccessForApplicableGate()
        {
            Gate notApplicableGate = new Gate("notApplicable1");

            UnitTestGateContext context = new UnitTestGateContext {
                AlwaysReturnApplicable = false
            };

            GatesNone gateCombination = new GatesNone(notApplicableGate);

            Assert.True(gateCombination.IsApplicable(context, out IGate[] gates), "Get applicable gates should be true");
            Assert.Null(gates);
        }
Ejemplo n.º 3
0
        public void IsApplicable_WithOneApplicableGate_ReturnsNoApplicableGate()
        {
            Gate applicableGate = new Gate("applicable1");

            UnitTestGateContext context = new UnitTestGateContext {
                AlwaysReturnApplicable = false
            };

            context.ApplicableGates = new string[] { applicableGate.Name };
            GatesNone gateCombination = new GatesNone(applicableGate);

            Assert.False(gateCombination.IsApplicable(context, out IGate[] gates), "Get applicable gates should be false");
            Assert.Null(gates);
        }
Ejemplo n.º 4
0
        public void IsApplicable_WithTwoNotApplicableGates_ReturnsSuccessForApplicableGates()
        {
            Gate notApplicableGate1 = new Gate("notApplicable1");
            Gate notApplicableGate2 = new Gate("notApplicable2");

            UnitTestGateContext context = new UnitTestGateContext {
                AlwaysReturnApplicable = false
            };

            context.ApplicableGates = new string[] { };
            GatesNone gateCombination = new GatesNone(notApplicableGate1, notApplicableGate2);

            Assert.True(gateCombination.IsApplicable(context, out IGate[] gates), "Get applicable gates should be true");
            Assert.Null(gates);
        }