public async Task PostAsync_Succeeds()
        {
            //Arrange
            var requestData = ProjectedNoticeDateTestsDataGenerator.GetValidRequestData();
            var response    = ProjectedNoticeDateTestsDataGenerator.GetValidResponseData();

            _service.Setup(m => m.PerformProjectedNoticeDateCalculationAsync(requestData, _confOptions)).ReturnsAsync(response);
            var projectedNoticeDateController = new ProjectedNoticeDateController(_service.Object, _mockLogger.Object, _confOptions);

            //Act
            var result = await projectedNoticeDateController.PostAsync(requestData);

            //Assert
            var okObjectResult = result.Should().BeOfType <OkObjectResult>().Subject;

            okObjectResult.StatusCode.Should().Be((int)System.Net.HttpStatusCode.OK);
            var responseDto = okObjectResult.Value.Should().BeOfType <ProjectedNoticeDateResponseDTO>().Subject;

            responseDto.ProjectedNoticeDate.Should().Be(new DateTime(2018, 01, 08));

            _mockLogger.Verify(x => x.Log(
                                   LogLevel.Information,
                                   It.IsAny <EventId>(),
                                   It.Is <object>(v =>
                                                  v.ToString().Contains("Calculation performed successfully for the request data provided")),
                                   null,
                                   It.IsAny <Func <object, Exception, string> >()
                                   ));
        }
        public void PingGet_ReturnsSuccess()
        {
            //Arrange
            var projectedNoticeDateController = new ProjectedNoticeDateController(_service.Object, _mockLogger.Object, _confOptions);

            //Act
            var result = projectedNoticeDateController.Get();

            //Assert
            var contentResult = result.Should().BeOfType <ContentResult>().Subject;

            contentResult.StatusCode.Should().Be((int)System.Net.HttpStatusCode.OK);
            contentResult.Content.Should().Be("PingGet response from RPS Api ProjectedNoticeDate");
        }
        public async Task PostAsync_ReturnsBadRequest_WhenRequestData_IsNull()
        {
            //Arrange
            var projectedNoticeDateController = new ProjectedNoticeDateController(_service.Object, _mockLogger.Object, _confOptions);

            //Act
            var result = await projectedNoticeDateController.PostAsync(null);

            //Assert
            var badRequestObjectRequest = result.Should().BeOfType <BadRequestObjectResult>().Subject;

            badRequestObjectRequest.StatusCode.Should().Be((int)System.Net.HttpStatusCode.BadRequest);
            _mockLogger.Verify(x => x.Log(
                                   LogLevel.Error,
                                   It.IsAny <EventId>(),
                                   It.Is <object>(v =>
                                                  v.ToString().Contains("Bad payload")),
                                   null,
                                   It.IsAny <Func <object, Exception, string> >()
                                   ));
        }
        public async Task PostAsync_ReturnsBadRequest_ForInvalidRequestData_DismissalDateBeforeEmploymentStartDate()
        {
            //Arrange
            var requestData = ProjectedNoticeDateTestsDataGenerator.GetInvalidRequestData_DismissalDataBeforeEmployeeStartDate();
            var projectedNoticeDateController = new ProjectedNoticeDateController(_service.Object, _mockLogger.Object, _confOptions);

            //Act
            var result = await projectedNoticeDateController.PostAsync(requestData);

            //Assert
            var badRequest = result.Should().BeOfType <BadRequestObjectResult>().Subject;
            var statusCode = badRequest.StatusCode.Should().Be((int)System.Net.HttpStatusCode.BadRequest);

            _mockLogger.Verify(x => x.Log(
                                   LogLevel.Error,
                                   It.IsAny <EventId>(),
                                   It.Is <object>(v => v.ToString().Contains("'Dismissal Date' can not be before the Employment Start Date")),
                                   null,
                                   It.IsAny <Func <object, Exception, string> >()
                                   ));
        }