public void Add_InvalidPolynomial_400BadRequest(string inputA, string inputB) { var controller = new PolynomialController(); var result = controller.Add(inputA, inputB); result.ShouldNotBeNull(); var objectResult = result.ShouldBeOfType <BadRequestResult>(); objectResult.StatusCode.ShouldBe(400); }
public void Add_ValidInputPolynomial_200CorrectOutputPolynomial( string inputA, string inputB, string expectedOutput) { var controller = new PolynomialController(); var result = controller.Add(inputA, inputB); result.ShouldNotBeNull(); var objectResult = result.ShouldBeOfType <OkObjectResult>(); objectResult.StatusCode.ShouldBe(200); var dtoPolynomial = objectResult.Value.ShouldBeOfType <DTOs.Polynomial>(); dtoPolynomial.StringForm.ShouldBe(expectedOutput); }