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.

58 lines
894 B

  1. #include "unity.h"
  2. #include "kgV.h"
  3. #include "ggT.h"
  4. void setUp(void){}
  5. void tearDown(void){}
  6. void test_kgV8And6(void) {
  7. //arrange
  8. int a = 8;
  9. int b = 6;
  10. int expected = 24;
  11. //act
  12. int result = kgV(a, b);
  13. //assert
  14. TEST_ASSERT_EQUAL_INT(expected, result);
  15. }
  16. void test_kgVOfFirstNumberZero(){
  17. //arrange
  18. int a = 0;
  19. int b = 5;
  20. int expected = 0;
  21. //act
  22. int result = kgV(a, b);
  23. //assert
  24. TEST_ASSERT_EQUAL_INT(expected, result);
  25. }
  26. void test_kgVOfSecondNumberZero(){
  27. //arrange
  28. int a = 5;
  29. int b = 0;
  30. int expected = 0;
  31. //act
  32. int result = kgV(a, b);
  33. //assert
  34. TEST_ASSERT_EQUAL_INT(expected, result);
  35. }
  36. void test_kgVOfBothNumbersZero(){
  37. //arrange
  38. int a = 0;
  39. int b = 0;
  40. int expected = 0;
  41. //act
  42. int result = kgV(a, b);
  43. //assert
  44. TEST_ASSERT_EQUAL_INT(expected, result);
  45. }