public static EmployeeCreateRequest CreateRequestObj(string empName, string age, string salary) { EmployeeCreateRequest createRequest = new EmployeeCreateRequest(); createRequest.name = empName; createRequest.age = age; createRequest.salary = salary; return(createRequest); }
public void AddEmployeeThenDeleteAndValidateDetails(string age, string salary, string empname) { long empid; EmployeeCreateRequest empCreateRequest = Util.CreateRequestObj(empname, age, salary); string requestbody = JsonConvert.SerializeObject(empCreateRequest); resources.EmployeeResource.AddEmployeeAndValidate(EndPoint.AddEmployee, Method.POST, "", out empid); string employeeupdateendpoint = EndPoint.DeleteEmployee + empid; resources.EmployeeResource.DeleteEmployeeAndValidate(employeeupdateendpoint, Method.PUT); }
public void AddOneEmployeeAndValidateDetails(string age, string salary, string empname) { long empid; EmployeeCreateRequest empCreateRequest = Util.CreateRequestObj(empname, age, salary); string requestbody = JsonConvert.SerializeObject(empCreateRequest); resources.EmployeeResource.AddEmployeeAndValidate(EndPoint.AddEmployee, Method.POST, "", out empid); Employee expectedEmployee = Util.CreateExpectedEmployeeObj(age, salary, empname, empid); string employeegetendpoint = EndPoint.GetEmployee + empid; resources.EmployeeResource.GetEmployeeAndValidateData(employeegetendpoint, expectedEmployee); }