diff --git a/src/CustomerData.txt b/src/CustomerData.txt index 4f5c877..cd3f176 100644 --- a/src/CustomerData.txt +++ b/src/CustomerData.txt @@ -3,18 +3,18 @@ ID=1234 forename=Max Surname=Mustermann password=example -balance=2390 +balance=2340 1327=example ID=1327 forename=Max Surname=Mustermann password=example -balance=70 +balance=20 1666=example ID=1666 forename=Max Surname=Mustermann password=example -balance=240 \ No newline at end of file +balance=190 diff --git a/tests/test_withdrawMoney.c b/tests/test_withdrawMoney.c index ccb95c8..d4c6045 100644 --- a/tests/test_withdrawMoney.c +++ b/tests/test_withdrawMoney.c @@ -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 + } + +} +