From f7a2bf74ac0b0b2475427200d8acc25d8b66acaa Mon Sep 17 00:00:00 2001 From: fdai7514 Date: Thu, 2 Feb 2023 18:15:41 +0100 Subject: [PATCH] update with new Passwords in showGeneralInfoEmployee.c and test_showGeneralInfoEmployee.h --- src/showGeneralInfoEmployee.c | 12 ++++++------ src/showGeneralInfoEmployee.h | 4 ++-- tests/test_showGeneralInfoEmployee.c | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/showGeneralInfoEmployee.c b/src/showGeneralInfoEmployee.c index 3bbb353..25355c9 100644 --- a/src/showGeneralInfoEmployee.c +++ b/src/showGeneralInfoEmployee.c @@ -3,32 +3,32 @@ //int checkUser() is helpful for unittesting showGeneralInfoEmployee() int checkUser(char username[length], char password[length]) { - if(strcmp(username,"Atharva")==0 && strcmp(password,"Atharva")==0) + if(strcmp(username,"Atharva")==0 && strcmp(password,"Atharvafdai7514")==0) { return 1; } - if(strcmp(username,"Can")==0 && strcmp(password,"BlooMask")==0) + if(strcmp(username,"Can")==0 && strcmp(password,"BlooMaskfdlt3817")==0) { return 2; } - if(strcmp(username,"Haytham")==0 && strcmp(password,"TimoDL")==0) + if(strcmp(username,"Haytham")==0 && strcmp(password,"TimoDLfdai7207")==0) { return 3; } - if(strcmp(username,"Julius")==0 && strcmp(password,"Insertcat")==0) + if(strcmp(username,"Julius")==0 && strcmp(password,"Insertcatfdai7057")==0) { return 4; } - if(strcmp(username,"Mohamed")==0 && strcmp(password,"MD")==0) + if(strcmp(username,"Mohamed")==0 && strcmp(password,"MDfdai6618")==0) { return 5; } - if(strcmp(username,"Shivam")==0 && strcmp(password,"Schivam007")==0) + if(strcmp(username,"Shivam")==0 && strcmp(password,"Schivam007fdlt3781")==0) { return 6; } diff --git a/src/showGeneralInfoEmployee.h b/src/showGeneralInfoEmployee.h index 984b035..bfedbbe 100644 --- a/src/showGeneralInfoEmployee.h +++ b/src/showGeneralInfoEmployee.h @@ -6,6 +6,6 @@ #include const int length = 100; -int checkUser(char a[length], char b[length]); -void showGeneralInfoEmployee(char id[length], char p[length]); +int checkUser(char username[length], char password[length]); +void showGeneralInfoEmployee(char id[length], char password[length]); #endif // SHOWGENERALINFOEMPLOYEE_H diff --git a/tests/test_showGeneralInfoEmployee.c b/tests/test_showGeneralInfoEmployee.c index 4a58a83..0d1084c 100644 --- a/tests/test_showGeneralInfoEmployee.c +++ b/tests/test_showGeneralInfoEmployee.c @@ -16,42 +16,42 @@ void tearDown(void) void test1_showGeneralInfoEmployee(void) { char employeeName[] = "Atharva"; //Arrange - char password[] = "Atharva"; + char password[] = "Atharvafdai7514"; int ergebnis = checkUser(employeeName, password); //Act TEST_ASSERT_EQUAL_INT(1, ergebnis); //Assert } void test2_showGeneralInfoEmployee(void) { char employeeName[] = "Can"; //Arrange - char password[] = "BlooMask"; + char password[] = "BlooMaskfdlt3817"; int ergebnis = checkUser(employeeName, password); //Act TEST_ASSERT_EQUAL_INT(2, ergebnis); //Assert } void test3_showGeneralInfoEmployee(void) { char employeeName[] = "Haytham"; //Arrange - char password[] = "TimoDL"; + char password[] = "TimoDLfdai7207"; int ergebnis = checkUser(employeeName, password); //Act TEST_ASSERT_EQUAL_INT(3, ergebnis); //Assert } void test4_showGeneralInfoEmployee(void) { char employeeName[] = "Julius"; //Arrange - char password[] = "Insertcat"; + char password[] = "Insertcatfdai7057"; int ergebnis = checkUser(employeeName, password); //Act TEST_ASSERT_EQUAL_INT(4, ergebnis); //Assert } void test5_showGeneralInfoEmployee(void) { char employeeName[] = "Mohamed"; //Arrange - char password[] = "MD"; + char password[] = "MDfdai6618"; int ergebnis = checkUser(employeeName, password); //Act TEST_ASSERT_EQUAL_INT(5, ergebnis); //Assert } void test6_showGeneralInfoEmployee(void) { char employeeName[] = "Shivam"; //Arrange - char password[] = "Schivam007"; + char password[] = "Schivam007fdlt3781"; int ergebnis = checkUser(employeeName, password); //Act TEST_ASSERT_EQUAL_INT(6, ergebnis); //Assert }