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