Browse Source

update with new Passwords in showGeneralInfoEmployee.c and test_showGeneralInfoEmployee.h

remotes/origin/feature/show-general-info-employee
fdai7514 2 years ago
parent
commit
f7a2bf74ac
  1. 12
      src/showGeneralInfoEmployee.c
  2. 4
      src/showGeneralInfoEmployee.h
  3. 12
      tests/test_showGeneralInfoEmployee.c

12
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;
}

4
src/showGeneralInfoEmployee.h

@ -6,6 +6,6 @@
#include <string.h>
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

12
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
}

Loading…
Cancel
Save