Exemplo n.º 1
0
        public void TestNotEvaluatorReturnsNullWhenConditionIsNull()
        {
            var notCondition = new NotCondition {
                Condition = null
            };

            Assert.That(notCondition.Evaluate(null, null, Logger), Is.Null);
        }
Exemplo n.º 2
0
        public void TestNotEvaluatorReturnsNullWhenOperandEvaluateToNull()
        {
            var notCondition = new NotCondition {
                Condition = NullCondition
            };

            Assert.That(notCondition.Evaluate(null, null, Logger), Is.Null);
        }
Exemplo n.º 3
0
        public void TestNotEvaluatorReturnsFalseWhenOperandEvaluateToTrue()
        {
            var notCondition = new NotCondition {
                Condition = TrueCondition
            };

            Assert.That(notCondition.Evaluate(null, null, Logger), Is.False);
        }
Exemplo n.º 4
0
    public void Evaluate(bool value)
    {
        var variables = A.Dummy <IVariableDictionary>();

        var condition = A.Fake <ICondition>(i => i.Strict());

        A.CallTo(() => condition.Evaluate(variables)).Returns(value);

        var sut    = new NotCondition(condition);
        var actual = sut.Evaluate(variables);

        actual.Should().Be(!value);
    }