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.
 
 
 
 

69 lines
1.3 KiB

#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