|
|
@ -147,7 +147,7 @@ void test_verifyPasswordFailure() |
|
|
|
void test_employeesDataStoringSuccess(void) |
|
|
|
{ |
|
|
|
/*Arrange*/ |
|
|
|
char*data[][4] ={ |
|
|
|
char* data[][4] ={ |
|
|
|
{"John","Doe","fulda,leipzigerstr12","+4926428421469"}, |
|
|
|
{"Jane","Done","fulda,leipzigerstr13","+4932517359874"}, |
|
|
|
{"Foo","Bar","fulda,leipzigerstr14","+4913598765315"}, |
|
|
@ -190,4 +190,52 @@ void test_employeeCreatedSuccessfully(void) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void test_validName(void) |
|
|
|
{ |
|
|
|
/*Arrange*/ |
|
|
|
|
|
|
|
char* validNames[] = {"John","Jane","Fizz","Foo","Atharva","Can","Julius","Haytham","Mohamed","Shivam"}; |
|
|
|
int minimalLength = 4; |
|
|
|
bool validNamesResult[10]; |
|
|
|
|
|
|
|
/*Act*/ |
|
|
|
|
|
|
|
for(int i = 0;i<10;i++) |
|
|
|
{ |
|
|
|
validNamesResult[i] = isValidName(validNames[i],minimalLength); |
|
|
|
} |
|
|
|
|
|
|
|
/*Assert*/ |
|
|
|
|
|
|
|
for(int i = 0;i<10;i++) |
|
|
|
{ |
|
|
|
TEST_ASSERT_TRUE(validNames[i]); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void test_invalidName(void) |
|
|
|
{ |
|
|
|
/*Arrange*/ |
|
|
|
|
|
|
|
char* invalidNames[] = {"Jo hn","Jane.","Fizz36","Foo8","Ath,arva","C .a1n","Jul132ius","123Haytham",".Mohamed"," Shivam"}; |
|
|
|
int minimalLength = 4; |
|
|
|
bool invalidNamesResult[10]; |
|
|
|
|
|
|
|
/*Act*/ |
|
|
|
|
|
|
|
for(int i = 0;i<10;i++) |
|
|
|
{ |
|
|
|
invalidNamesResult[i] = isValidName(invalidNames[i],minimalLength); |
|
|
|
} |
|
|
|
|
|
|
|
/*Assert*/ |
|
|
|
|
|
|
|
for(int i = 0;i<10;i++) |
|
|
|
{ |
|
|
|
TEST_ASSERT_FALSE(invalidNamesResult[i]); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endif // TEST |