title: Use Cast as part of test or explicitly use Assert.IsInstanceOfType
body: <p>I am pretty new to testing and have been writing my Controller tests as follows:</p>
  
  <pre><code>var result = myController.Create(It.IsAny&lt;int&gt;());
  
  Assert.IsInstanceOfType(result, typeof(ViewResult));
  Assert.AreEqual(string.Empty, ((ViewResult)result).ViewName, "Default view expected.");
  Assert.IsInstanceOfType(((ViewResult)result).ViewData.Model, typeof(FooBarCreateEditViewModel));
  </code></pre>
  
  <p>This works fine but is not as readable in that I am having to perform a cast for Tests 2 &amp; 3. An alternative approach might be to do the following:</p>
  
  <pre><code>var result = (ViewResult)myController.Create(It.IsAny&lt;int&gt;());
  
  Assert.AreEqual(string.Empty, result.ViewName, "Default view expected.");
  Assert.IsInstanceOfType(result.ViewData.Model, typeof(FooBarCreateEditViewModel));
  </code></pre>
  
  <p>This also seems to work and is more readable in my opinion. My problem with it is that it relies on the "act" part of the test to perform the IsInstanceOfType test, rather than explicitly defining an Assert to do the job.</p>
  
  <p>So is my second apporach ok to continue with? I am likely to run into issues with relying on the cast to throw an error should the method return a different type?</p>