I think you need to manually mock the HttpConext, Request & Headers. You can create a fake HttpContext & then assign it to the your main controller.