Browse Source

refactoring: removed redundant code from the unit test of the employeeAccess() function.

remotes/origin/feature/the-main-menu
fdai7207 2 years ago
parent
commit
fdf0bcd9ca
  1. 13
      test/test_employeeLogin.c

13
test/test_employeeLogin.c

@ -132,21 +132,16 @@ void test_invalidEmployeeAccessCode(void)
/*Arrange*/ /*Arrange*/
char* invalidAccessCode[] = {"15","foo","fizz","buzz","fizzbuzz","test","bankmanagement"}; char* invalidAccessCode[] = {"15","foo","fizz","buzz","fizzbuzz","test","bankmanagement"};
bool invalidCodeResults[7];
bool invalidCodeExpectation = false;
/*Act*/
/*Act and assert*/
for(int i=0;i<7;i++) for(int i=0;i<7;i++)
{ {
invalidCodeResults[i] = employeesAccess(invalidAccessCode[i]);
bool invalidCodeResults = employeesAccess(invalidAccessCode[i]);
TEST_ASSERT_EQUAL(invalidCodeExpectation,invalidCodeResults);
} }
/*Assert*/
for(int i=0;i<7;i++)
{
TEST_ASSERT_FALSE(invalidCodeResults[i]);
}
} }
#endif // TEST #endif // TEST
Loading…
Cancel
Save