|
@ -108,4 +108,45 @@ void test_MissingLoginEmployee(void) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_validEmployeeAccessCode(void) |
|
|
|
|
|
{ |
|
|
|
|
|
//test case 0 |
|
|
|
|
|
|
|
|
|
|
|
/*Arrange*/ |
|
|
|
|
|
|
|
|
|
|
|
char validAccesscode[11] = "DF9E9A8B5E"; |
|
|
|
|
|
|
|
|
|
|
|
/*Act*/ |
|
|
|
|
|
bool validAccessCodeResult = employeesAccess(validAccesscode); |
|
|
|
|
|
|
|
|
|
|
|
/*Assert*/ |
|
|
|
|
|
|
|
|
|
|
|
TEST_ASSERT_TRUE(validAccessCodeResult); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_invalidEmployeeAccessCode(void) |
|
|
|
|
|
{ |
|
|
|
|
|
//test case 1 |
|
|
|
|
|
|
|
|
|
|
|
/*Arrange*/ |
|
|
|
|
|
|
|
|
|
|
|
char* invalidAccessCode[] = {"15","foo","fizz","buzz","fizzbuzz","test","bankmanagement"}; |
|
|
|
|
|
bool invalidCodeResults[7]; |
|
|
|
|
|
|
|
|
|
|
|
/*Act*/ |
|
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<7;i++) |
|
|
|
|
|
{ |
|
|
|
|
|
invalidCodeResults[i] = employeesAccess(invalidAccessCode[i]); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*Assert*/ |
|
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<7;i++) |
|
|
|
|
|
{ |
|
|
|
|
|
TEST_ASSERT_FALSE(invalidCodeResults[i]); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
#endif // TEST |
|
|
#endif // TEST |