public async Task PostAsync_SucceedsWithOverlappingPeriodsInDifferentInputSources() { //Arrange var request = new HolidayCalculationRequestModel() { Hpa = null, Htnp = new List <HolidayTakenNotPaidCalculationRequestModel>() { new HolidayTakenNotPaidCalculationRequestModel(InputSource.Rp14a, new DateTime(2018, 10, 6), new DateTime(2018, 10, 6), new DateTime(2018, 9, 10), new DateTime(2018, 9, 18), 320m, new List <string> { "1", "2", "3", "4", "5" }, 6, true), new HolidayTakenNotPaidCalculationRequestModel(InputSource.Rp1, new DateTime(2018, 10, 6), new DateTime(2018, 10, 6), new DateTime(2018, 9, 18), new DateTime(2018, 9, 20), 320m, new List <string> { "1", "2", "3", "4", "5" }, 6, true), } }; var response = HolidayControllerTestsDataGenerator.GetValidResponseData(); _service.Setup(m => m.PerformHolidayCalculationAsync(request, _confOptions)).ReturnsAsync(response); var controller = new HolidayController(_service.Object, _mockLogger.Object, _confOptions); //Act var result = await controller.PostAsync(request); //Assert var okObjectRequest = result.Should().BeOfType <OkObjectResult>().Subject; okObjectRequest.StatusCode.Should().Be((int)System.Net.HttpStatusCode.OK); }
public async Task PostAsync_Succeeds() { //Arrange var request = HolidayControllerTestsDataGenerator.GetValidRequestData(); var response = HolidayControllerTestsDataGenerator.GetValidResponseData(); _service.Setup(m => m.PerformHolidayCalculationAsync(request, _confOptions)).ReturnsAsync(response); var controller = new HolidayController(_service.Object, _mockLogger.Object, _confOptions); //Act var result = await controller.PostAsync(request); //Assert var okObjectRequest = result.Should().BeOfType <OkObjectResult>().Subject; okObjectRequest.StatusCode.Should().Be((int)System.Net.HttpStatusCode.OK); }