Beispiel #1
0
        public void InsertAsync_Returns_Success()
        {
            _testOutput.WriteLine("Objeto deve retornar 1.");
            var employeeRequest = Builder <EmployeeRequest>
                                  .CreateNew()
                                  .With(p => p.GrossSalary        = "1000")
                                  .With(p => p.NumberOfDependants = "2")
                                  .Build();

            var employee = EmployeeServiceMapper.ConvertRequestToObject(employeeRequest);
            var name     = employee.Name;
            var expected = Task.FromResult(1);

            _mockUoW
            .Setup(x => x.EmployeeRepository.AddAsync(employee))
            .Verifiable();

            _service.InsertAsync(employeeRequest);

            Assert.NotNull(employee);
            Assert.NotNull(employeeRequest);
            Assert.IsType <EmployeeRequest>(employeeRequest);
            Assert.IsType <Employee>(employee);
        }
Beispiel #2
0
        public void InsertAsync(EmployeeRequest employeeRequest)
        {
            var employee = EmployeeServiceMapper.ConvertRequestToObject(employeeRequest);

            _unitOfWork.EmployeeRepository.AddAsync(employee);
        }