public async Task AddEmployeeWithNoDependents()
        {
            //Arrange
            var testEmployee = new Employee {
                FirstName = "Ben", LastName = "Heil"
            };

            //Act
            var employee = await employeeRepository.AddEmployeeAsync(testEmployee);

            //Assert
            Assert.AreNotEqual(employee.EmployeeId, 0);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Post([FromBody] Employee employee)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            await _repository.AddEmployeeAsync(employee);

            return(Ok());
        }