Skip to content

Instantly share code, notes, and snippets.

@DoubleCouponDay
Created May 17, 2019 02:40
Show Gist options
  • Select an option

  • Save DoubleCouponDay/9b1ceea4897791e12342c2a957a60d49 to your computer and use it in GitHub Desktop.

Select an option

Save DoubleCouponDay/9b1ceea4897791e12342c2a957a60d49 to your computer and use it in GitHub Desktop.
mock HttpActionContext
actionmock = new HttpActionContext();
var headerValue = new AuthenticationHeaderValue("Basic", "bzUwkDal=");
var request = new HttpRequestMessage();
request.Headers.Authorization = headerValue;
var controllerContext = new HttpControllerContext();
controllerContext.Request = request;
var context = new HttpActionContext();
context.ControllerContext = controllerContext;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment