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.

69 lines
1.3 KiB

  1. #ifdef TEST
  2. #include <sendmoney.h>
  3. #include <unity.h>
  4. void setUp(void)
  5. {
  6. }
  7. void tearDown(void)
  8. {
  9. }
  10. // hier wird die Methode checkAccount getestet
  11. void test_sendmoney_NeedToImplement(void)
  12. {
  13. // Arrage
  14. int accountNumber = 1234567;
  15. int accountNumber2 = 5555557;
  16. // hier soll false sein
  17. int accountNumber3 = 53323;
  18. int accountNumber4 = 34342;
  19. bool expected;
  20. bool expected2;
  21. bool expected3;
  22. bool expected4;
  23. // Act
  24. expected = checkAccount(accountNumber);
  25. expected2 = checkAccount(accountNumber2);
  26. expected3 = checkAccount(accountNumber3);
  27. expected4 = checkAccount(accountNumber4);
  28. // Assert
  29. TEST_ASSERT_TRUE(expected);
  30. TEST_ASSERT_TRUE(expected2);
  31. TEST_ASSERT_FALSE(expected3);
  32. TEST_ASSERT_FALSE(expected4);
  33. }
  34. // hier wird die Methode getAvailableAccountBalance()getestet
  35. void test_getAvailableAccountBalance(void)
  36. {
  37. // Arrage
  38. double expected1 = 24.0;
  39. int length = 2;
  40. // Act
  41. double result = getAvailableAccountBalance(length);
  42. // Assert
  43. TEST_ASSERT_EQUAL(expected1, result);
  44. }
  45. // hier wird die Methode getAmount() getestet
  46. void test_getAmount(void)
  47. {
  48. // Arrage
  49. float expected = 500.1;
  50. float result = getAmount(expected);
  51. TEST_ASSERT_EQUAL(expected, result);
  52. }
  53. #endif // TEST