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.

47 lines
592 B

  1. #ifdef TEST
  2. #include "unity.h"
  3. #include "Modules.c"
  4. void setUp(void)
  5. {
  6. }
  7. void tearDown(void)
  8. {
  9. }
  10. void test_checkBallPosition_output_if_goal(void)
  11. {
  12. /* arrange */
  13. binX = 1;
  14. binY = 1;
  15. ballX = 1;
  16. ballY = 3;
  17. /* act */
  18. int output = checkBallPosition();
  19. /* assert */
  20. TEST_ASSERT_EQUAL(1, output);
  21. }
  22. void test_checkBallPosition_output_if_no_goal(void)
  23. {
  24. /* arrange */
  25. binX = 1;
  26. binY = 1;
  27. ballX = 1;
  28. ballY = 1;
  29. /* act */
  30. int output = checkBallPosition();
  31. /* assert */
  32. TEST_ASSERT_EQUAL(2, output);
  33. }
  34. #endif // TEST