void thirdTestCase04(void) { int i; employee* pEmployee; i = 0; pEmployee = findEmployeeById(arrayEmployees, 0, id[i]); utest_assertNullMsg(pEmployee,"Error in return value <addEmployees> if LENGTH of array is invalid, the correct value to return is: (NULL)"); }
void thirdTestCase04(void) { int i; employee* pEmployee; i = 0; pEmployee = findEmployeeById(arrayEmployees, 0, id[i]); utest_assertNullMsg(pEmployee,"Error en valor de retorno, si se recibe una logitud erronea [length < 1]\nel valor a retornar es (NULL)"); }
void thirdTestCase03(void) { int i; employee* pEmployee; i = 0; pEmployee = findEmployeeById(NULL, LENGTH, id[i]); utest_assertNullMsg(pEmployee,"Error in return value <addEmployees> if array pointer is NULL, the correct value to return is: (NULL)"); }
void thirdTestCase03(void) { int i; employee* pEmployee; i = 0; pEmployee = findEmployeeById(NULL, LENGTH, id[i]); utest_assertNullMsg(pEmployee,"Error en valor de retorno, si se recibe un puntero NULL el valor a retornar es (NULL)"); }
void thirdTestCase05(void) { employee* pEmployee; pEmployee = findEmployeeById(arrayEmployees, LENGTH, 1000); utest_assertNullMsg(pEmployee,"Error en valor de retorno, si no se encontro un empleado\nel valor a retornar es (NULL)"); }
void thirdTestCase01(void) { int i; employee* pEmployee; i = 4; pEmployee = findEmployeeById(arrayEmployees, LENGTH, id[i]); utest_assertNotNullMsg(pEmployee,"Error the pointer is NULL"); }
void thirdTestCase01(void) { int i; employee* pEmployee; i = 4; pEmployee = findEmployeeById(arrayEmployees, LENGTH, id[i]); utest_assertNotNullMsg(pEmployee,"Error en valor de retorno, si se encontro un empleado el valor es distinto de NULL"); }
void thirdTestCase02(void) { int i; employee* pEmployee; i = 4; pEmployee = findEmployeeById(arrayEmployees, LENGTH, id[i]); utest_assertNotNullMsg(pEmployee,"Error the pointer is NULL"); utest_assertEqualsIntMsg(pEmployee->id,id[i],"Error value in <.id>"); utest_assertEqualsStringMsg(pEmployee->name,unsortedList[i],2,"Error value in <.name>"); utest_assertEqualsStringMsg(pEmployee->lastName,unsortedList[i],2,"Error value in <.lastName>"); utest_assertEqualsFloatMsg(pEmployee->salary,salary[i],"Error value in <.salary>"); utest_assertEqualsIntMsg(pEmployee->sector,sector[i],"Error value in <.sector>"); utest_assertEqualsIntMsg(pEmployee->isEmpty,0,"Error value in <.isEmpty> the correct value is: (0)"); }
void thirdTestCase02(void) { int i; employee* pEmployee; i = 4; pEmployee = findEmployeeById(arrayEmployees, LENGTH, id[i]); utest_assertNotNullMsg(pEmployee,"Error en valor de retorno, si se encontro un empleado el valor es distinto de NULL"); utest_assertEqualsIntMsg(pEmployee->id,id[i],"Error de valor en <.id>"); utest_assertEqualsStringMsg(pEmployee->name,unsortedList[i],2,"Error de valor en <.name>"); utest_assertEqualsStringMsg(pEmployee->lastName,unsortedList[i],2,"Error de valor en <.lastName>"); utest_assertEqualsFloatMsg(pEmployee->salary,salary[i],"Error de valor en <.salary>"); utest_assertEqualsIntMsg(pEmployee->sector,sector[i],"Error de valor en <.sector>"); utest_assertEqualsIntMsg(pEmployee->isEmpty,0,"Error de valor en <.isEmpty> el valor correcto para\nindicar que la posicion esta ocupada es (0)"); }
int main() { Employee employees[LEN_EMPLOYEES]; initEmployees(employees,LEN_EMPLOYEES); char seguir = 'S'; int id; char name[51]; char lastName[51]; float salary; int sector; do { system("cls");//system("clear"); switch(menu()) { case 1: system("cls");//system("clear"); printf("---------ALTA--------\n\n"); id = getId(); strncpy(name,getStringSoloLetras("Ingrese NOMBRE: "),51); strncpy(lastName,getStringSoloLetras("Ingrese APELLIDO: "),51); salary = getFloat("Ingrese SALARIO: "); sector = getInt("Ingrese SECTOR: "); system("cls");//system("clear"); if(addEmployee(employees,LEN_EMPLOYEES,id,name,lastName,salary,sector) == -1) { printf("Error al ingresar datos!"); } system("pause"); break; case 2: system("cls");//system("clear"); if(verifyAllEmpty(employees,LEN_EMPLOYEES) == 0) { printf("NO HAY EMPLEADOS INGRESADOS!\n"); } else { printf("------------MODIFICAR-----------\n\n"); printEmployees(employees,LEN_EMPLOYEES); id = getInt("\n\nIngrese ID del empleado que desea modificar: "); if(findEmployeeById(employees,LEN_EMPLOYEES,id) == -1) { printf("NO EXISTE ESTE EMPLEADO\n"); system("pause"); break; } if(modifyEmployee(employees,LEN_EMPLOYEES,id) == -1) { printf("\nError!"); } } system("pause"); system("cls");//system("clear"); break; case 3: system("cls");//system("clear"); if(verifyAllEmpty(employees,LEN_EMPLOYEES) == 0) { printf("NO HAY EMPLEADOS INGRESADOS!\n"); } else { printf("------------ELIMINAR-----------\n\n"); printEmployees(employees,LEN_EMPLOYEES); id = getInt("\n\nIngrese ID del empleado que desea eliminar: "); if(findEmployeeById(employees,LEN_EMPLOYEES,id) == -1) { printf("NO EXISTE ESTE EMPLEADO\n"); system("pause"); break; } if(removeEmployee(employees,LEN_EMPLOYEES,id) == -1) { printf("\nError!"); } } system("pause"); system("cls");//system("clear"); break; case 4: system("cls");//system("clear"); if(verifyAllEmpty(employees,LEN_EMPLOYEES) == 0) { printf("NO HAY EMPLEADOS INGRESADOS!\n"); } else { printf("------------INFORMAR-----------\n\n"); sortEmployees(employees,LEN_EMPLOYEES); printEmployees(employees,LEN_EMPLOYEES); } system("pause"); system("cls"); break; } }while(seguir == 'S'); return 0; }