unitTest.cpp 742 B

1234567891011121314
  1. Describe(basic_tests)
  2. {
  3. It(test1){Assert::That(rightTriangle(3, 4, 5), Equals(true));}
  4. It(test2){Assert::That(rightTriangle(145, 105, 100), Equals(true));}
  5. It(test3){Assert::That(rightTriangle(70, 130, 110), Equals(false));}
  6. It(test4){Assert::That(rightTriangle(60, 60, 60), Equals(false));}
  7. // A triangle can't have an edge of length 0.
  8. It(test5){Assert::That(rightTriangle(0, 4, 4), Equals(false));}
  9. // A triangle can't have edges of negative length.
  10. It(test6){Assert::That(rightTriangle(-3, 4, 5), Equals(false));}
  11. It(test7){Assert::That(rightTriangle(115, 277, 252), Equals(true));}
  12. It(test8){Assert::That(rightTriangle(140, 170, 220), Equals(false));}
  13. It(test9){Assert::That(rightTriangle(915, 1748, 1973), Equals(true));}
  14. };