Other questions that mention null ViewResults actually seem to be referring to null Models (something I definitely *do* plan to test for). I am brand new to testing. Just started my first project using TDD today. Several of the resources I found, and even the stock testing code for a new MVC project, show testing the ViewResult for null:

```
// Stock code
[TestMethod]
public void Index()
{
    // Arrange
    HomeController controller = new HomeController();

    // Act
    ViewResult result = controller.Index() as ViewResult;

    // Assert
    Assert.IsNotNull(result);
}

```

I am wondering why this is necessary. Given my limited experience, I can think of only 2 reasons why the ViewResult would be null:

Reason 1: You return the wrong type, like a JsonResult or something - which could be done if the method returns a general ActionResult. I could see this being a legit reason, but I am not sure it's a requirement my method needs to return a ViewResult specifically. In fact, maybe I want it to be easily changeable down the road. 

Reason 2: You explicitly return null. But in the real world, why would you do that? 

Can someone give other examples of when the ViewResult would be null, and explain why (or why not) it's important to test for? My experience is limited as I said, so there is liable to be something I am not seeing - that's why I am asking.

**EDIT**  

Apologies if I formatted my question poorly. Let me clarify: I understand it's bad if it's null, and understand the value in testing for null *if nulls are possible/likely*. I am more concerned with A. *how/why* would it be null in the first place, and B. whether these reasons are legit reasons that would add value to test, or whether they're edge cases unlikely to ever happen in the real world. 

 **Did my Reason 1 and Reason 2 cover all of the scenarios? If not, what others are there? If they are edge cases, highly unlikely to happen, do you still test for them?**