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.

40 lines
697 B

  1. #ifdef TEST
  2. #include "unity.h"
  3. #include "depositMoney.h"
  4. #include "updateCustomerAccountBalance.c"
  5. #include "currentCustomerAccountBalance.c"
  6. void setUp(void)
  7. {
  8. }
  9. void tearDown(void)
  10. {
  11. }
  12. void test_depositSpecificAmount(void) {
  13. /* Arrange */
  14. int length = 5;
  15. int userIDs[] = {1234,1235,1236,1237,1238};
  16. float amountToDeposit[] = {200.5, 340, 244.5, 340, 1200};
  17. bool result[length];
  18. /* Act */
  19. for (int i = 0; i < length; i++) {
  20. result[i] = depositSpecificAmount( userIDs[i], amountToDeposit[i] );
  21. }
  22. /* Assert */
  23. for (int i = 0; i < length; i++) {
  24. TEST_ASSERT_TRUE(result[i]);
  25. }
  26. }
  27. #endif // TEST