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

  1. #ifdef TEST
  2. #include "unity.h"
  3. #include "createEmployeeAccount.h"
  4. void setUp(void)
  5. {
  6. }
  7. void tearDown(void)
  8. {
  9. }
  10. void test_isValidEmployeeID(void)
  11. {
  12. /*Arrange*/
  13. char* validEmployeeId [] = {"Atharva","Can","Haytham","Julius","Mohamed","Shivam","Fizz","Buzz","JohnDoe","Foobar","waz","Objectoriented","INSTITUTIONALISATIOL","Intercommunicational","1234","1.6"};
  14. bool validEmployeeIdResult[15];
  15. /*Act*/
  16. for(int i=0; i<15; i++)
  17. {
  18. validEmployeeIdResult[i] = isValidEmployeeID(validEmployeeId[i]);
  19. }
  20. /*Assert*/
  21. for(int i =0; i<15;i++)
  22. {
  23. TEST_ASSERT_TRUE(validEmployeeIdResult[i]);
  24. }
  25. }
  26. void test_isNotValidEmployeeID(void)
  27. {
  28. /*Arrange*/
  29. char* invalidEmployeeId [] = {"Atha rva","Ca n","Geschwindigkeitsbegrenzungen","1234 15","John Doe","fizz Fuzz"};
  30. bool invalidEmployeeIdResult[6];
  31. /*Act*/
  32. for(int i=0; i<6; i++)
  33. {
  34. invalidEmployeeIdResult[i] = isValidEmployeeID(invalidEmployeeId[i]);
  35. }
  36. /*Assert*/
  37. for(int i =0; i<6;i++)
  38. {
  39. TEST_ASSERT_FALSE(invalidEmployeeIdResult[i]);
  40. }
  41. }
  42. #endif // TEST