|
|
@ -1,5 +1,6 @@ |
|
|
|
#include "unity.h" |
|
|
|
#include "kgV.h" |
|
|
|
#include "ggT.h" |
|
|
|
|
|
|
|
void setUp(void){} |
|
|
|
void tearDown(void){} |
|
|
@ -13,5 +14,45 @@ void test_kgV8And6(void) { |
|
|
|
//act |
|
|
|
int result = kgV(a, b); |
|
|
|
|
|
|
|
//assert |
|
|
|
TEST_ASSERT_EQUAL_INT(expected, result); |
|
|
|
} |
|
|
|
|
|
|
|
void test_kgVOfFirstNumberZero(){ |
|
|
|
//arrange |
|
|
|
int a = 0; |
|
|
|
int b = 5; |
|
|
|
int expected = 0; |
|
|
|
|
|
|
|
//act |
|
|
|
int result = kgV(a, b); |
|
|
|
|
|
|
|
//assert |
|
|
|
TEST_ASSERT_EQUAL_INT(expected, result); |
|
|
|
} |
|
|
|
|
|
|
|
void test_kgVOfSecondNumberZero(){ |
|
|
|
//arrange |
|
|
|
int a = 5; |
|
|
|
int b = 0; |
|
|
|
int expected = 0; |
|
|
|
|
|
|
|
//act |
|
|
|
int result = kgV(a, b); |
|
|
|
|
|
|
|
//assert |
|
|
|
TEST_ASSERT_EQUAL_INT(expected, result); |
|
|
|
} |
|
|
|
|
|
|
|
void test_kgVOfBothNumbersZero(){ |
|
|
|
//arrange |
|
|
|
int a = 0; |
|
|
|
int b = 0; |
|
|
|
int expected = 0; |
|
|
|
|
|
|
|
//act |
|
|
|
int result = kgV(a, b); |
|
|
|
|
|
|
|
//assert |
|
|
|
TEST_ASSERT_EQUAL_INT(expected, result); |
|
|
|
} |