HTTPSimulator - Simulating HTTP Requests for unit testing made easier

My blog has moved. You can view this post at the following address: http://www.osherove.com/blog/2007/6/20/httpsimulator-simulating-http-requests-for-unit-testing-made.html
Published Wednesday, June 20, 2007 4:20 PM by RoyOsherove

Comments

Sunday, August 26, 2007 5:27 AM by Ulu

# re: HTTPSimulator - Simulating HTTP Requests for unit testing made easier

I've discovered a way to achieve better testability with Asp.Net. We have several frameworks that can provide the html output of your test page, but the problem is that these are actually integration tests (so you have to setup your dependencies instead of mocking them), and also these are low-level tests (you look for substrings in the html output instead of directly testing your control's properties).

My recipe is: Plasma + TypeMock. I use Plasma for in-process testing and TypeMock to get access to the HTTPContext and Page objects. So far, I haven't used it in any tests, but I've got a valid reference to my page and verified that its controls are there, and this is a big step.

The details are here: dotfresh.blogspot.com/.../aspnet-tesability-finally-way-it-should.html

ulu