title: How do I test an async method with NUnit (or possibly with another framework)?
body: <p>I have an ASP.NET Web API application, with an ApiController that features asynchronous methods, returning <code>Task&lt;&gt;</code> objects and marked with the <code>async</code> keyword.</p>
  
  <pre><code>public class MyApiController : ApiController
  {
      public async Task&lt;MyData&gt; GetDataById(string id)
      {
          ...
      }
  }
  </code></pre>
  
  <p>How can I write NUnit tests for the ApiController's asynchronous methods? If I need to use another testing framework I'm open for that too. I'm fairly new to .NET unit testing in general, so I'm interested in learning best practices.</p>