Ask Your Question

Revision history [back]

In ASP.Net Core MVC testing, the method to check for NotFound() is to use the Assert.IsType<notfoundresult>(result) method, where "result" is the ActionResult returned by the controller action. This method checks if the result type is of the NotFoundResult class, which is typically returned when a resource is not found. If the result type is not of the NotFoundResult class, then the test will fail.