title: Mock HostingEnvironment.QueueBackgroundWorkItem in xunit test
body: <p>I have a method using 
  <code>HostingEnvironment.QueueBackgroundWorkItem</code> which I wish to unit test some behaviour before this call, however, the test is failing with <code>System.InvalidOperationException : Operation is not valid due to the current state of the object.</code></p>
  
  <p>I suspect this I need to mock the HostingEnvironment but unaware of how to.</p>