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.
 
 
 
 

37 lines
692 B

#ifdef TEST
#include "unity.h"
#include "withdrawMoney.h"
void setUp(void)
{
}
void tearDown(void)
{
}
void test_initiateWithdraw(void) {
float amountToWithdraw[] = {200.5, 340, 244.5, 340};
float availableAccountBalance[] = {2000, 3400, 2445, 3400};
float expectedValue[4];
float result[4];
for (int i = 0; i < 4; i++) {
expectedValue[i] = ( availableAccountBalance[i] - amountToWithdraw[i] );
}
for (int i = 0; i < 4; i++) {
result[i] = initiateWithdraw( amountToWithdraw[i], availableAccountBalance[i] );
}
for (int i = 0; i < 4; i++) {
TEST_ASSERT_EQUAL_FLOAT(expectedValue[i],result[i]);
}
}
#endif // TEST