public void CreateEmployee(EmployeeDto employeeDto)
        {
            try
            {
                using (var httpRequestScope = AutofacHostFactory.Container.BeginLifetimeScope(MatchingScopeLifetimeTags.RequestLifetimeScopeTag))
                {
                    var employeeService = httpRequestScope.Resolve<IEmployeeManager>();

                    var employee = this.dtoToEmployeeMapper.Map(employeeDto);
                    employeeService.CreateEmployee(employee);
                }
            }
            catch (Exception ex)
            {
                throw new FaultException(ex.Message);
            }
        }
        public void Post()
        {
            // Arrange
            var employee = new EmployeeDto { FirstName = "James", LastName = "Last" };
            int employeeId = 99;

            var employeeManagerMock = new Mock<IEmployeeManager>();
            employeeManagerMock.Setup(m => m.CreateEmployee(It.IsAny<Model.Employee>())).Returns<Model.Employee>(
                entity =>
                    {
                        entity.Id = employeeId;
                        return entity;
                    });

            var dtoToEmployeeMapperMock = new Mock<IMapper<EmployeeDto, Model.Employee>>();
            dtoToEmployeeMapperMock.Setup(m => m.Map(It.IsAny<EmployeeDto>()))
                .Returns<EmployeeDto>(dto => new Model.Employee { Id = dto.Id, FirstName = dto.FirstName, LastName = dto.LastName });

            var employeeToDtoMapperMock = new Mock<IMapper<Model.Employee, EmployeeDto>>();
            employeeToDtoMapperMock.Setup(m => m.Map(It.IsAny<Model.Employee>()))
                .Returns<Model.Employee>(entity => new EmployeeDto { Id = entity.Id, FirstName = entity.FirstName, LastName = entity.LastName });

            var employeeController = new EmployeeController(
                employeeManagerMock.Object,
                dtoToEmployeeMapperMock.Object,
                employeeToDtoMapperMock.Object);

            // Act
            var actionResult = employeeController.Post(employee);

            // Assert
            var contentResult = Assert.IsType<CreatedAtRouteNegotiatedContentResult<EmployeeDto>>(actionResult);

            contentResult.Content.Id.Should().Be(employeeId);
            contentResult.Content.FirstName.Should().Be("James");
            contentResult.Content.LastName.Should().Be("Last");
        }