You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
380 B
15 lines
380 B
#define CATCH_CONFIG_MAIN
|
|
|
|
#include <catch2/catch.hpp>
|
|
|
|
int Factorial( int number ) {
|
|
return number <= 1 ? 1 : Factorial( number - 1 ) * number;
|
|
}
|
|
|
|
TEST_CASE( "Factorial Tests", "[single-file]" ) {
|
|
REQUIRE( Factorial(0) == 1 );
|
|
REQUIRE( Factorial(1) == 1 );
|
|
REQUIRE( Factorial(2) == 2 );
|
|
REQUIRE( Factorial(3) == 6 );
|
|
REQUIRE( Factorial(10) == 3628800 );
|
|
} |