16 lines
448 B
C++
16 lines
448 B
C++
// include the unit test framework first
|
|
#include <catch2/catch_test_macros.hpp>
|
|
|
|
// include the module you're going to test next
|
|
#include "Matrix.hpp"
|
|
|
|
unsigned int Factorial(unsigned int number) {
|
|
return number <= 1 ? number : Factorial(number - 1) * number;
|
|
}
|
|
|
|
TEST_CASE("Factorials are computed", "[factorial]") {
|
|
REQUIRE(Factorial(1) == 1);
|
|
REQUIRE(Factorial(2) == 2);
|
|
REQUIRE(Factorial(3) == 6);
|
|
REQUIRE(Factorial(10) == 3628800);
|
|
} |