|
|
@ -230,18 +230,13 @@ void test_validPhoneNumber(void) |
|
|
|
{ |
|
|
|
/*Arrange*/ |
|
|
|
char* validPhoneNumbers[] = {"+4903584736198","+4912345678912","+4987541024534","+4932145784236","+4987264287139"}; |
|
|
|
bool validPhoneNumbersResult[5]; |
|
|
|
bool validPhoneNumbersExpectation = true; |
|
|
|
|
|
|
|
/*Act*/ |
|
|
|
/*Act and Assert*/ |
|
|
|
for(int i =0;i<5;i++) |
|
|
|
{ |
|
|
|
validPhoneNumbersResult[i] = isValidPhoneNumber(validPhoneNumbers[i]); |
|
|
|
} |
|
|
|
|
|
|
|
/*Assert*/ |
|
|
|
for(int i=0;i<5;i++) |
|
|
|
{ |
|
|
|
TEST_ASSERT_TRUE(validPhoneNumbersResult[i]); |
|
|
|
bool validPhoneNumbersResult = isValidPhoneNumber(validPhoneNumbers[i]); |
|
|
|
TEST_ASSERT_EQUAL(validPhoneNumbersExpectation, validPhoneNumbersResult); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -249,19 +244,15 @@ void test_invalidPhoneNumber(void) |
|
|
|
{ |
|
|
|
/*Arrange*/ |
|
|
|
char* invalidPhoneNumbers[] = {"+490358473619812","+6112345678912","+498754","-4932145784236","123"}; |
|
|
|
bool invalidPhoneNumbersResult[2]; |
|
|
|
bool invalidPhoneNumbersExpectation = false; |
|
|
|
|
|
|
|
/*Act*/ |
|
|
|
/*Act and Assert*/ |
|
|
|
for(int i =0;i<5;i++) |
|
|
|
{ |
|
|
|
invalidPhoneNumbersResult[i] = isValidPhoneNumber(invalidPhoneNumbers[i]); |
|
|
|
bool invalidPhoneNumbersResult = isValidPhoneNumber(invalidPhoneNumbers[i]); |
|
|
|
TEST_ASSERT_EQUAL(invalidPhoneNumbersExpectation,invalidPhoneNumbersResult); |
|
|
|
} |
|
|
|
|
|
|
|
/*Assert*/ |
|
|
|
for(int i=0;i<5;i++) |
|
|
|
{ |
|
|
|
TEST_ASSERT_FALSE(invalidPhoneNumbersResult[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif // TEST |