public async Task CalculationController_Either__WrongProbabilityA_BadRequest() { var calculationRequest = SeedData.CreateInvalidCalculationRequestWithWrongProbabilityA(); var calculationController = GetCalculationController(); var actionResult = await calculationController.CalculateEitherFunction(calculationRequest); var badRequestResult = Assert.IsType <BadRequestObjectResult>(actionResult); Assert.NotNull(badRequestResult); Assert.Equal(400, badRequestResult.StatusCode); }
public async Task CalculationController_CombineWith__WrongProbabilityA_BadRequest() { var calculationRequest = SeedData.CreateInvalidCalculationRequestWithWrongProbabilityA(); var calculationController = GetCalculationController(); var actionResult = await calculationController.CalculateCombinedWithFunction(calculationRequest); var badRequestResult = Assert.IsType <BadRequestObjectResult>(actionResult); Assert.NotNull(badRequestResult); Assert.Equal(400, badRequestResult.StatusCode); Assert.Equal("Value [1.5] is not valid (Parameter 'Value')", badRequestResult.Value); }