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.

93 lines
1.4 KiB

  1. #ifdef TEST
  2. #include "unity.h"
  3. #include "funktionen.h"
  4. void setUp(void)
  5. {
  6. }
  7. void tearDown(void)
  8. {
  9. }
  10. void test_1000_plus_1(void)
  11. {
  12. /* arrange */
  13. int actual;
  14. int expected = 1000;
  15. /* act */
  16. actual = addThreeNumbers(500, 249, 251);
  17. /* assert */
  18. TEST_ASSERT_EQUAL_INT(expected, actual);
  19. }
  20. void test_11_multiplied_by_11(void)
  21. {
  22. /* arrange */
  23. int actual;
  24. int expected = 121;
  25. /* act */
  26. actual = multiply(11, 11);
  27. /* assert */
  28. TEST_ASSERT_EQUAL_INT(expected, actual);
  29. }
  30. void test_5_minus_2(void)
  31. {
  32. /* arrange */
  33. int actual;
  34. int expected = 3;
  35. /* act */
  36. actual = subtract(5, 2);
  37. /* assert */
  38. TEST_ASSERT_EQUAL_INT(expected, actual);
  39. }
  40. void test_24_divided_by_3(void)
  41. {
  42. /* arrange */
  43. int actual;
  44. int expected = 8;
  45. /* act */
  46. actual = divide(24, 3);
  47. /* assert */
  48. TEST_ASSERT_EQUAL_INT(expected, actual);
  49. }
  50. void test_2_toThePowerOf_7(void)
  51. {
  52. /* arrange */
  53. int actual;
  54. int expected = 128;
  55. /* act */
  56. actual = power(2, 7);
  57. /* assert */
  58. TEST_ASSERT_EQUAL_INT(expected, actual);
  59. }
  60. void test_x_wins_onIndex_00_10_20(void)
  61. {
  62. /* arrange */
  63. int actual;
  64. int expected = 1;
  65. char board[][3] = {{'X',' ',' '}, {'X',' ',' '}, {'X',' ',' '}};
  66. /* act */
  67. actual = x_wins_00_10_20(board);
  68. /* assert */
  69. TEST_ASSERT_EQUAL_INT(expected, actual);
  70. }
  71. #endif