title: How to get the object from HttpActionResult Ok method (Web Api)?
body: <p>I'm learning some Web Api basics and I want to return and pass an object by <code>Ok(object)</code>. Something like this:</p>
  
  <pre><code>[HttpGet]
  public IHttpActionResult Get()
  {
      var someString = "";
      return Ok(someString);
  }
  </code></pre>
  
  <p>Now I want to test this method and to assert if the returned string from this Get() method is the same as expected. I Guess will look something like this:</p>
  
  <pre><code>[TestMethod]
  public void TestGet()
  {
      IHttpActionResult result = controller.Get();
      Assert.AreEqual("", result.??);
  }
  </code></pre>
  
  <p>I saw <a href="https://stackoverflow.com/questions/19936892/how-do-i-unit-test-web-api-action-method-when-it-returns-ihttpactionresult">this</a> question but the best answer is explaining how to validate the <code>HttpStatusCode</code>, not the passed object.</p>