@ -18,13 +18,19 @@ void test_isValidEmployeeID(void)
/*Arrange*/
char * validEmployeeId [ ] = { " Atharva " , " Can " , " Haytham " , " Julius " , " Mohamed " , " Shivam " , " Fizz " , " Buzz " , " JohnDoe " , " Foobar " , " waz " , " Objectoriented " , " INSTITUTIONALISATIOL " , " Intercommunicational " , " 1234 " , " 1.6 " } ;
int validStringLengths [ 15 ] ;
bool validEmployeeIdExpected = true ;
for ( int i = 0 ; i < 15 ; i + + )
{
validStringLengths [ i ] = 20 ;
}
/*Act and Assert*/
for ( int i = 0 ; i < 15 ; i + + )
{
bool validEmployeeIdResult = isValidEmployeeID ( validEmployeeId [ i ] ) ;
bool validEmployeeIdResult = isValidEmployeeID ( validEmployeeId [ i ] , validStringLengths [ i ] ) ;
TEST_ASSERT_EQUAL ( validEmployeeIdExpected , validEmployeeIdResult ) ;
}
}
@ -35,13 +41,18 @@ void test_isNotValidEmployeeID(void)
/*Arrange*/
char * invalidEmployeeId [ ] = { " Atha rva " , " Ca n " , " Geschwindigkeitsbegrenzungen " , " 1234 15 " , " John Doe " , " fizz Fuzz " } ;
int invalidStringLengths [ 6 ] ;
bool invalidEmployeeIdExpected = false ;
for ( int i = 0 ; i < 6 ; i + + )
{
invalidStringLengths [ i ] = 20 ;
}
/*Act and Assert*/
for ( int i = 0 ; i < 6 ; i + + )
{
bool invalidEmployeeIdResult = isValidEmployeeID ( invalidEmployeeId [ i ] ) ;
bool invalidEmployeeIdResult = isValidEmployeeID ( invalidEmployeeId [ i ] , invalidStringLengths [ i ] ) ;
TEST_ASSERT_EQUAL ( invalidEmployeeIdExpected , invalidEmployeeIdResult ) ;
}