title: How to moq HttpContext on Asp net Core
body: <p>I have an asp .net core project, and practically in each action we use session, my question is how to test it if I don't have sessionRepository. Controller tests crush because session in controller is null. I try to Moq IHttpContextAcessor and it also doesn't work.   </p>
  
  <p>I try this:</p>
  
  <pre><code>HttpContext.Current = new HttpContext(new HttpRequest(null, "http://tempuri.org", null), new HttpResponse(null));
  
  </code></pre>
  
  <p>but HttpContext doesn't contain the definition for Current. (using Microsoft.AspNetCore.Http;)</p>
  
  <p>Is there any way to moq or test controllers that use HttpContext and sessions?</p>