Пример #1
0
 public void RulesCanBeCombinedUsingTheAndOperator()
 {
     Assert.That(aRuleThatIsTrue.And(aRuleThatIsTrue).IsTrueFor(new AnyClass()));
     Assert.That(aRuleThatIsTrue.And(aRuleThatIsFalse).IsFalseFor(new AnyClass()));
     Assert.That(aRuleThatIsFalse.And(aRuleThatIsTrue).IsFalseFor(new AnyClass()));
     Assert.That(aRuleThatIsFalse.And(aRuleThatIsFalse).IsFalseFor(new AnyClass()));
 }
        public void AnAndRuleCanBeEvaluatedAndDescribed()
        {
            var rule = aRuleThatIsTrue.And(aRuleThatIsFalse);

            var description = describer.Describe(rule);

            Assert.That(description, Is.EqualTo("Always True[T] AND[F] Always False[F]"));
        }
Пример #3
0
        public void AnAndRuleCanBeDescribed()
        {
            var rule = aRuleThatIsTrue.And(aRuleThatIsFalse);

            var description = describer.Describe(rule);

            Assert.That(description, Is.EqualTo("(Always True AND Always False)"));
        }
        public void UnneededParenthesisAreNotShown()
        {
            var anAndRule      = aRuleThatIsTrue.And(aRuleThatIsFalse);
            var anotherAndRule = aRuleThatIsTrue.And(aRuleThatIsTrue);

            var rule = anAndRule.And(anotherAndRule);

            var description = describer.Describe(rule);

            Assert.That(description, Is.EqualTo("Always True AND Always False AND Always True AND Always True"));
        }