fdlt3817
2 years ago
5 changed files with 60 additions and 86 deletions
-
6src/depositMoney.c
-
56src/sendmoney.c
-
1src/sendmoney.h
-
69tests/test_sendmoney.c
-
14tests/test_updateCustomerAccountBalance.c
@ -1,69 +0,0 @@ |
|||||
#ifdef TEST |
|
||||
#include <sendmoney.h> |
|
||||
#include <unity.h> |
|
||||
|
|
||||
void setUp(void) |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
void tearDown(void) |
|
||||
{ |
|
||||
} |
|
||||
// hier wird die Methode checkAccount getestet |
|
||||
void test_sendmoney_NeedToImplement(void) |
|
||||
{ |
|
||||
// Arrage |
|
||||
|
|
||||
int accountNumber = 1234567; |
|
||||
int accountNumber2 = 5555557; |
|
||||
|
|
||||
// hier soll false sein |
|
||||
int accountNumber3 = 53323; |
|
||||
int accountNumber4 = 34342; |
|
||||
bool expected; |
|
||||
bool expected2; |
|
||||
bool expected3; |
|
||||
bool expected4; |
|
||||
// Act |
|
||||
|
|
||||
expected = checkAccount(accountNumber); |
|
||||
expected2 = checkAccount(accountNumber2); |
|
||||
expected3 = checkAccount(accountNumber3); |
|
||||
expected4 = checkAccount(accountNumber4); |
|
||||
|
|
||||
// Assert |
|
||||
|
|
||||
TEST_ASSERT_TRUE(expected); |
|
||||
TEST_ASSERT_TRUE(expected2); |
|
||||
TEST_ASSERT_FALSE(expected3); |
|
||||
TEST_ASSERT_FALSE(expected4); |
|
||||
} |
|
||||
|
|
||||
// hier wird die Methode getAvailableAccountBalance()getestet |
|
||||
void test_getAvailableAccountBalance(void) |
|
||||
{ |
|
||||
|
|
||||
// Arrage |
|
||||
|
|
||||
double expected1 = 24.0; |
|
||||
int length = 2; |
|
||||
|
|
||||
// Act |
|
||||
|
|
||||
double result = getAvailableAccountBalance(length); |
|
||||
|
|
||||
// Assert |
|
||||
TEST_ASSERT_EQUAL(expected1, result); |
|
||||
} |
|
||||
// hier wird die Methode getAmount() getestet |
|
||||
void test_getAmount(void) |
|
||||
{ |
|
||||
// Arrage |
|
||||
float expected = 500.1; |
|
||||
|
|
||||
float result = getAmount(expected); |
|
||||
|
|
||||
TEST_ASSERT_EQUAL(expected, result); |
|
||||
} |
|
||||
|
|
||||
#endif // TEST |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue