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
24 lines
834 B
#include <unity.h>
|
|
#include "../src/loginCustomer.c"
|
|
#include "../src/customerMenu.c"
|
|
#include "../src/helperFunctions.c"
|
|
#include "../src/error.c"
|
|
void setUp(){};
|
|
void tearDown(){};
|
|
void test_checkLogin()
|
|
{
|
|
/*arrange*/
|
|
bool expected_test_values_compute_to_true[] = {4==4,true==true, 1==1, false==false, 'z'=='z', '='=='=',0x1A==0x1A};
|
|
int length_1 = sizeof(expected_test_values_compute_to_true)/sizeof(bool);
|
|
|
|
bool expected_test_values_compute_to_false[] = {4!=4,true==false,1==0,false==true,'z'=='x','!'==')',0x1A==0x2B};
|
|
int length_2 = sizeof(expected_test_values_compute_to_false)/sizeof(bool);
|
|
|
|
/*act and assertions*/
|
|
for(int i=0;i<7;++i) {
|
|
TEST_ASSERT_TRUE(checkLogin(expected_test_values_compute_to_true[i]));
|
|
}
|
|
for(int i=0;i<7;++i){
|
|
TEST_ASSERT_FALSE(checkLogin(expected_test_values_compute_to_false[i]));
|
|
}
|
|
}
|