Exemplo n.º 1
0
        public void SinglePositiveOddDigitReporterHandlesEvenNumbers()
        {
            var result = OptionMatcherExamples.SinglePositiveOddDigitReporter(Option <int> .Some(2)) +
                         OptionMatcherExamples.SinglePositiveOddDigitReporter(Option <int> .Some(4)) +
                         OptionMatcherExamples.SinglePositiveOddDigitReporter(Option <int> .Some(6));

            AreEqual("2 isn't odd4 isn't odd6 isn't odd", result);
        }
Exemplo n.º 2
0
        public void SinglePositiveOddDigitReporterPrints1357And9Correctly()
        {
            var result = OptionMatcherExamples.SinglePositiveOddDigitReporter(Option <int> .Some(1)) +
                         OptionMatcherExamples.SinglePositiveOddDigitReporter(Option <int> .Some(3)) +
                         OptionMatcherExamples.SinglePositiveOddDigitReporter(Option <int> .Some(5)) +
                         OptionMatcherExamples.SinglePositiveOddDigitReporter(Option <int> .Some(7)) +
                         OptionMatcherExamples.SinglePositiveOddDigitReporter(Option <int> .Some(9));

            AreEqual("13579", result);
        }
Exemplo n.º 3
0
        public void SinglePositiveOddDigitReporterHandlesNone()
        {
            var result = OptionMatcherExamples.SinglePositiveOddDigitReporter(Option <int> .None());

            AreEqual("There was no value", result);
        }
Exemplo n.º 4
0
        public void SinglePositiveOddDigitReporterHandlesNegative()
        {
            var result = OptionMatcherExamples.SinglePositiveOddDigitReporter(Option <int> .Some(-20));

            AreEqual("-20 isn't positive", result);
        }
Exemplo n.º 5
0
        public void SinglePositiveOddDigitReporterHandles10()
        {
            var result = OptionMatcherExamples.SinglePositiveOddDigitReporter(Option <int> .Some(10));

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