public void Display_NonExistingPet_ReturnsHttp404() { // Arrange string petName = "Barney"; SetControllerContext(petName); // Act var result = _controller.DisplayHttpNotFound() as HttpStatusCodeResult; // Assert // The action method returned an action result Assert.IsNotNull(result); // The action result is an HttpStatusCodeResult object Assert.IsInstanceOfType(result, typeof(HttpStatusCodeResult)); // The HTTP code is 404 (not found) Assert.AreEqual(404, result.StatusCode); }