Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }