|
|
@ -18,20 +18,14 @@ void test_isValidEmployeeID(void) |
|
|
|
/*Arrange*/ |
|
|
|
|
|
|
|
char* validEmployeeId [] = {"Atharva","Can","Haytham","Julius","Mohamed","Shivam","Fizz","Buzz","JohnDoe","Foobar","waz","Objectoriented","INSTITUTIONALISATIOL","Intercommunicational","1234","1.6"}; |
|
|
|
bool validEmployeeIdResult[15]; |
|
|
|
bool validEmployeeIdExpected = true; |
|
|
|
|
|
|
|
/*Act*/ |
|
|
|
/*Act and Assert*/ |
|
|
|
|
|
|
|
for(int i=0; i<15; i++) |
|
|
|
{ |
|
|
|
validEmployeeIdResult[i] = isValidEmployeeID(validEmployeeId[i]); |
|
|
|
} |
|
|
|
|
|
|
|
/*Assert*/ |
|
|
|
|
|
|
|
for(int i =0; i<15;i++) |
|
|
|
{ |
|
|
|
TEST_ASSERT_TRUE(validEmployeeIdResult[i]); |
|
|
|
bool validEmployeeIdResult = isValidEmployeeID(validEmployeeId[i]); |
|
|
|
TEST_ASSERT_EQUAL(validEmployeeIdExpected,validEmployeeIdResult); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -41,22 +35,16 @@ void test_isNotValidEmployeeID(void) |
|
|
|
/*Arrange*/ |
|
|
|
|
|
|
|
char* invalidEmployeeId [] = {"Atha rva","Ca n","Geschwindigkeitsbegrenzungen","1234 15","John Doe","fizz Fuzz"}; |
|
|
|
bool invalidEmployeeIdResult[6]; |
|
|
|
bool invalidEmployeeIdExpected = false; |
|
|
|
|
|
|
|
/*Act*/ |
|
|
|
/*Act and Assert*/ |
|
|
|
|
|
|
|
for(int i=0; i<6; i++) |
|
|
|
{ |
|
|
|
invalidEmployeeIdResult[i] = isValidEmployeeID(invalidEmployeeId[i]); |
|
|
|
} |
|
|
|
|
|
|
|
/*Assert*/ |
|
|
|
|
|
|
|
for(int i =0; i<6;i++) |
|
|
|
{ |
|
|
|
TEST_ASSERT_FALSE(invalidEmployeeIdResult[i]); |
|
|
|
bool invalidEmployeeIdResult = isValidEmployeeID(invalidEmployeeId[i]); |
|
|
|
TEST_ASSERT_EQUAL(invalidEmployeeIdExpected,invalidEmployeeIdResult); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void test_employeeCreatedSuccessfully(void) |
|
|
@ -71,21 +59,15 @@ void test_employeeCreatedSuccessfully(void) |
|
|
|
{"MusterFrau", "MusterFrauPassword"} |
|
|
|
}; |
|
|
|
|
|
|
|
bool expected[6] = {true,true,true,true,true,true}; |
|
|
|
bool result[6]; |
|
|
|
bool expected = true; |
|
|
|
bool result; |
|
|
|
|
|
|
|
/*Act*/ |
|
|
|
/*Act and Assert*/ |
|
|
|
|
|
|
|
for(int i=0; i<6;i++) |
|
|
|
{ |
|
|
|
result[i] = createNewEmployee(potentialEmployees[i][0],potentialEmployees[i][1]); |
|
|
|
} |
|
|
|
|
|
|
|
/*Assert*/ |
|
|
|
|
|
|
|
for(int i=0; i<6;i++) |
|
|
|
{ |
|
|
|
TEST_ASSERT_EQUAL(expected[i],result[i]); |
|
|
|
result = createNewEmployee(potentialEmployees[i][0],potentialEmployees[i][1]); |
|
|
|
TEST_ASSERT_EQUAL(expected,result); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|