|
@ -63,6 +63,28 @@ void test_withdrawSpecificAmountSuccess(void) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_withdrawSpecificAmountFailure(void) { |
|
|
|
|
|
|
|
|
|
|
|
/* Arrange */ |
|
|
|
|
|
|
|
|
|
|
|
int user_id[3] = {12034, 13027, 16606}; // Random wrong user_ids |
|
|
|
|
|
|
|
|
|
|
|
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_FALSE(result[i]); // Pass if withdrawal fails and function returns false |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|