Beispiel #1
0
        public void SinglePositiveOddDigitAndTrueReporterHandlesEvenNumbers()
        {
            var result = UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(2)) +
                         UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(4)) +
                         UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(6));

            AreEqual("2 isn't odd4 isn't odd6 isn't odd", result);
        }
Beispiel #2
0
        public void SinglePositiveOddDigitAndTrueReporterPrints1357And9Correctly()
        {
            var result = UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(1)) +
                         UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(3)) +
                         UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(5)) +
                         UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(7)) +
                         UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(9));

            AreEqual("13579", result);
        }
Beispiel #3
0
        public void SinglePositiveOddDigitAndTrueReporterHandlesFalse()
        {
            var result = UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(false));

            AreEqual("False isn't true or single odd digit.", result);
        }
Beispiel #4
0
        public void SinglePositiveOddDigitAndTrueReporterHandlesTrue()
        {
            var result = UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(true));

            AreEqual("Found true", result);
        }
Beispiel #5
0
        public void SinglePositiveOddDigitAndTrueReporterHandlesNegative()
        {
            var result = UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(-20));

            AreEqual("-20 isn't positive", result);
        }
Beispiel #6
0
        public void SinglePositiveOddDigitAndTrueReporterHandles10()
        {
            var result = UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(10));

            AreEqual("10 isn't 1 digit", result);
        }