Thursday, September 01, 2005

Tim Weaver : NUnit with ASP.NET Context

NUnit with ASP.NET Context

Recently a bug was found in one of our components. Okay, so finding a bug isn't unusual, however what made this one stand out was that the component in question had over 70% code coverage with NUnit tests and it still wasn't found. Turns out the bug was related to the very small percent of code that relies on ASP.NET Context. The code isn't covered by our NUnit tests because frankly it is really hard to deal with ASP.NET context through unit tests.

I decided I wanted a way to get better coverage. Specifically I wanted to execute the code dependent on ASP.NET context. A quick google search turned up a few examples of how other people have tackled this. I took some of the examples I found and extended them to meet my requirements.
Post a Comment