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.

24 lines
834 B

  1. #include <unity.h>
  2. #include "../src/loginCustomer.c"
  3. #include "../src/customerMenu.c"
  4. #include "../src/helperFunctions.c"
  5. #include "../src/error.c"
  6. void setUp(){};
  7. void tearDown(){};
  8. void test_checkLogin()
  9. {
  10. /*arrange*/
  11. bool expected_test_values_compute_to_true[] = {4==4,true==true, 1==1, false==false, 'z'=='z', '='=='=',0x1A==0x1A};
  12. int length_1 = sizeof(expected_test_values_compute_to_true)/sizeof(bool);
  13. bool expected_test_values_compute_to_false[] = {4!=4,true==false,1==0,false==true,'z'=='x','!'==')',0x1A==0x2B};
  14. int length_2 = sizeof(expected_test_values_compute_to_false)/sizeof(bool);
  15. /*act and assertions*/
  16. for(int i=0;i<7;++i) {
  17. TEST_ASSERT_TRUE(checkLogin(expected_test_values_compute_to_true[i]));
  18. }
  19. for(int i=0;i<7;++i){
  20. TEST_ASSERT_FALSE(checkLogin(expected_test_values_compute_to_false[i]));
  21. }
  22. }