public void IssueErrorAndMessageShouldGenerateSolutionFail() { // Arrange // Act var result = sutFailure.Generate(); var message = ((SolutionResult)((NotFoundObjectResult)result.Result.Result).Value).Message; var statusCode = ((NotFoundObjectResult)result.Result.Result).StatusCode; // Assert Assert.That(result.Result, Is.InstanceOf <ActionResult <SudokuSolution> >()); Assert.That(message, Is.EqualTo("Status Code 404: Solution not Generated")); Assert.That(statusCode, Is.EqualTo(404)); }
public void SuccessfullyGenerateSolution() { // Arrange // Act var result = sutSuccess.Generate(); var message = ((SolutionResult)((OkObjectResult)result.Result.Result).Value).Message; var statusCode = ((OkObjectResult)result.Result.Result).StatusCode; // Assert Assert.That(result.Result, Is.InstanceOf <ActionResult <SudokuSolution> >()); Assert.That(message, Is.EqualTo("Status Code 200: Solution Generated")); Assert.That(statusCode, Is.EqualTo(200)); }