Пример #1
0
        public void CreateShouldCreateAnEmployee()
        {
            var employee = new Employee
            {
                EmployeeId = NewEmployeeId
            };

            var result = _connector.Create(employee);

            CheckForError(_connector);

            Assert.IsNotNull(result.EmployeeId);

            //Cleanup
            _connector.Update(new Employee {
                EmployeeId = result.EmployeeId, Inactive = true
            });
        }
        public void CreateShouldCreateAnEmployee()
        {
            var employedTo = DateTime.UtcNow.AddYears(1).ToString("yyyy-MM-dd");
            var employee   = new Employee
            {
                EmployeeId = NewEmployeeId,
                EmployedTo = employedTo,
            };

            var result = _connector.Create(employee);

            CheckForError(_connector);

            Assert.IsNotNull(result.EmployeeId);
            Assert.IsNotNull(result.EmployedTo);
            Assert.AreEqual(employedTo, result.EmployedTo);

            //Cleanup
            _connector.Update(new Employee {
                EmployeeId = result.EmployeeId, Inactive = true
            });
        }
        Employee CreateEmployee()
        {
            var employedTo = DateTime.UtcNow.AddYears(1).ToString("yyyy-MM-dd");
            var employee   = new Employee
            {
                EmployeeId = NewAttendanceTransactionEmployeeId,
                EmployedTo = employedTo,
            };

            var result = _employeeConnector.Create(employee);

            CheckForError(_connector);
            _employeeConnector.Update(new Employee {
                EmployeeId = employee.EmployeeId, Inactive = true
            });

            return(result);
        }