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.

35 lines
688 B

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