HttpContext.Current is null when unit test
<p>I have following web Api controller method.</p>

<p>When I run this code through web, <code>HttpContext.Current</code> is <code>never null</code> and give desired value.</p>

<pre class="lang-cs prettyprint-override"><code>public override void Post([FromBody]TestDTO model)
{

    var request = HttpContext.Current.Request;
    var testName = request.Headers.GetValues("OS Type")[0];
    // more code

}
</code></pre>

<p>However, when I call this method from <code>Unit Test</code>, <code>HttpContext.Current is always null.</code></p>

<p>How do i fix it?</p>