I’ve been writing some Unit tests this week to try and get good test coverage over a piece of code. And I was failing to cover an area that was concerned with the HTTP status codes returned from a web page. Whilst I thought my code worked, and I could test it on successfully returning web pages, I couldn’t work out an easy way to test some of the error conditions. I looked around the web a lot and finally tracked down httpstat.us via this stackoverflow question which just generates the appropriate page response. So a call to http://httpstat.us/404 simply returns a 404 Not Found response.

A great resource. (And blogged here mainly so that I can find it again next time I need it!)