How to mock HttpContext.Current.GetOwinContext() with Nunit and RhinoMocks?

Viewed 2070

Compared to my last question on Mocking the HttpContext, I had to change the method being tested to

public override void OnActionExecuting(HttpActionContext actionContext)
{
    HttpContext.Current.GetOwinContext().Set("RequestGUID", NewId.NextGuid());
    base.OnActionExecuting(actionContext);
}

Now I need to figure out how to mock the HttpContext.Current.GetOwinContext(), So I could write a stub for the Set() method, or generally being able to test this particular line. How can I do this?

1 Answers
Related