public void Passing0And4ToYesNo123OrOtherIntMatcherExampleHandledCorrectly() { var result = UnionMatcherExamples.YesNo123OrOtherIntMatcherExample(new Union <int, bool>(0)) + UnionMatcherExamples.YesNo123OrOtherIntMatcherExample(new Union <int, bool>(4)); AreEqual("int=0int=4", result); }
public void ElseExampleStillMatchesCorrectly() { var result = UnionMatcherExamples.ElseExample(new Union <int, bool>(0)) + UnionMatcherExamples.ElseExample(new Union <int, bool>(false)); AreEqual("0false", result); }
public void ElseExampleHandlesElseCorrectly() { var result = UnionMatcherExamples.ElseExample(new Union <int, bool>(1)) + UnionMatcherExamples.ElseExample(new Union <int, bool>(true)); AreEqual("????", result); }
public void Passing12And3ToYesNo123OrOtherIntMatcherExampleHandledCorrectly() { var result = UnionMatcherExamples.YesNo123OrOtherIntMatcherExample(new Union <int, bool>(1)) + UnionMatcherExamples.YesNo123OrOtherIntMatcherExample(new Union <int, bool>(2)) + UnionMatcherExamples.YesNo123OrOtherIntMatcherExample(new Union <int, bool>(3)); AreEqual("1 in range 1-32 in range 1-33 in range 1-3", result); }
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); }
public void SinglePositiveOddDigitAndTruePrinterHandlesFalse() { using (var sw = new StringWriter()) { Console.SetOut(sw); UnionMatcherExamples.SinglePositiveOddDigitAndTruePrinter(new Union <int, bool>(false)); AreEqual(ExpectedBuilder(new[] { "False isn't true or single odd digit." }), sw.ToString()); } }
public void SinglePositiveOddDigitAndTruePrinterHandlesTrue() { using (var sw = new StringWriter()) { Console.SetOut(sw); UnionMatcherExamples.SinglePositiveOddDigitAndTruePrinter(new Union <int, bool>(true)); AreEqual(ExpectedBuilder(new[] { "Found true" }), sw.ToString()); } }
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); }
public void SinglePositiveOddDigitAndTruePrinterHandlesEvenNumbers() { using (var sw = new StringWriter()) { Console.SetOut(sw); UnionMatcherExamples.SinglePositiveOddDigitAndTruePrinter(new Union <int, bool>(2)); UnionMatcherExamples.SinglePositiveOddDigitAndTruePrinter(new Union <int, bool>(4)); UnionMatcherExamples.SinglePositiveOddDigitAndTruePrinter(new Union <int, bool>(6)); AreEqual(ExpectedBuilder(new[] { "2 isn't odd", "4 isn't odd", "6 isn't odd" }), sw.ToString()); } }
public void SinglePositiveOddDigitAndTruePrinterPrints1357And9Correctly() { using (var sw = new StringWriter()) { Console.SetOut(sw); UnionMatcherExamples.SinglePositiveOddDigitAndTruePrinter(new Union <int, bool>(1)); UnionMatcherExamples.SinglePositiveOddDigitAndTruePrinter(new Union <int, bool>(3)); UnionMatcherExamples.SinglePositiveOddDigitAndTruePrinter(new Union <int, bool>(5)); UnionMatcherExamples.SinglePositiveOddDigitAndTruePrinter(new Union <int, bool>(7)); UnionMatcherExamples.SinglePositiveOddDigitAndTruePrinter(new Union <int, bool>(9)); AreEqual(ExpectedBuilder(new[] { "1", "3", "5", "7", "9" }), sw.ToString()); } }
public void SinglePositiveOddDigitAndTrueReporterHandles10() { var result = UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(10)); AreEqual("10 isn't 1 digit", result); }
public void SinglePositiveOddDigitAndTrueReporterHandlesNegative() { var result = UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(-20)); AreEqual("-20 isn't positive", result); }
public void SinglePositiveOddDigitAndTrueReporterHandlesTrue() { var result = UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(true)); AreEqual("Found true", result); }
public void PassingFalseToYesNo123OrOtherIntMatcherExampleReturnsNo() { var result = UnionMatcherExamples.YesNo123OrOtherIntMatcherExample(new Union <int, bool>(false)); AreEqual("No", result); }
public void PassingTrueToYesNo123OrOtherIntMatcherExampleReturnsYes() { var result = UnionMatcherExamples.YesNo123OrOtherIntMatcherExample(new Union <int, bool>(true)); AreEqual("Yes", result); }
public void PassingInAnIntToBoolOrIntMatcherExampleReturnsBool() { var result = UnionMatcherExamples.BoolOrIntMatcherExample(new Union <int, bool>(true)); AreEqual("bool=True", result); }
public void PassingInAnIntToBoolOrIntMatcherExampleReturnsAnInt() { var result = UnionMatcherExamples.BoolOrIntMatcherExample(new Union <int, bool>(2)); AreEqual("int=2", result); }
public void SinglePositiveOddDigitAndTrueReporterHandlesFalse() { var result = UnionMatcherExamples.SinglePositiveOddDigitAndTrueReporter(new Union <int, bool>(false)); AreEqual("False isn't true or single odd digit.", result); }