public async Task Edit_WhenAuthenticatedRequestReceivedWithInvalidModelState_ThenRedirectToReadViewActionReturned()
        {
            var employee       = EmployeeProvider.GetOnePreEditTestEmployee();
            var editedEmployee = EmployeeProvider.GetOnePostEditTestEmployee();

            _mockAuthService
            .Setup(a => a.IsAuthenticated(_user))
            .Returns(true);
            _mockRepository
            .Setup(r => r.EditAsync(employee.Id, editedEmployee))
            .ReturnsAsync(editedEmployee);

            var controller = new EmployeeController(_mockAuthService.Object, _mockRepository.Object, _mockService.Object);

            controller.ControllerContext = new ControllerContext()
            {
                HttpContext = new DefaultHttpContext()
                {
                    User = _user
                }
            };

            controller.ModelState.AddModelError("Forename", "Forename maximum length reached");
            var actual = await controller.Edit(employee.Id, editedEmployee) as RedirectToActionResult;

            Assert.IsNotNull(actual);
            Assert.IsTrue(actual.ActionName == "Read");
        }
        public async Task Edit_WhenUnAuthenticatedRequestReceived_ThenRedirectToSignInViewActionReturned()
        {
            var employee       = EmployeeProvider.GetOnePreEditTestEmployee();
            var editedEmployee = EmployeeProvider.GetOnePostEditTestEmployee();

            _mockAuthService
            .Setup(a => a.IsAuthenticated(_user))
            .Returns(false);
            _mockRepository
            .Setup(r => r.EditAsync(employee.Id, editedEmployee))
            .ReturnsAsync(editedEmployee);

            var controller = new EmployeeController(_mockAuthService.Object, _mockRepository.Object, _mockService.Object);

            var actual = await controller.Edit(employee.Id, editedEmployee) as RedirectToActionResult;

            Assert.IsNotNull(actual);
            Assert.IsTrue(actual.ActionName == "SignIn");
            Assert.IsTrue(actual.ControllerName == "Authentication");
        }