OpenRasta Mocking HttpContext in Unit Tests
c#, nunit, openrasta
Solution
You should not need to access `HttpContext.Current` directly. You should be able to use one of the available dependencies which are easily mockable.
Problem
Currently i am writing a unit tests for my handler methods using NUnit.I have used `HttpContext.Current` in one of my Controller Methods which throws NULL reference exception at `HttpContext.Current` when i execute test cases for my handler. Is there any way i can mock HttpContext?or is there any other way to solve this issue.