You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

62 lines
1.1 KiB

#ifdef TEST
#include "unity.h"
#include "createEmployeeAccount.h"
void setUp(void)
{
}
void tearDown(void)
{
}
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];
/*Act*/
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]);
}
}
void test_isNotValidEmployeeID(void)
{
/*Arrange*/
char* invalidEmployeeId [] = {"Atha rva","Ca n","Geschwindigkeitsbegrenzungen","1234 15","John Doe","fizz Fuzz"};
bool invalidEmployeeIdResult[6];
/*Act*/
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]);
}
}
#endif // TEST