Monday, 30 April 2018

Given: I needed to unit test that a response status code had been set within a controller action.
When: I didn't particularly want to refactor due to this being existing code.
Then: After experimenting unsuccessfully with creating various HttpContext classes, I found the simplest solution to be as follows within my test method: