|
@ -41,6 +41,28 @@ void test_initiateWithdraw(void) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_withdrawSpecificAmountSuccess(void) { |
|
|
|
|
|
|
|
|
|
|
|
/* Arrange */ |
|
|
|
|
|
|
|
|
|
|
|
int user_id[3] = {1234, 1327, 1666}; // user_ids from file for testing |
|
|
|
|
|
|
|
|
|
|
|
bool result[3]; |
|
|
|
|
|
|
|
|
|
|
|
/* Act */ |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 3; i++) { |
|
|
|
|
|
result[i] = withdrawSpecificAmount(user_id[i], 50); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Assert */ |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 3; i++) { |
|
|
|
|
|
TEST_ASSERT_TRUE(result[i]); // Pass if withdrawal is successful |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|