divider

Custom ASP.NET NUnit Test Runner

The custom ASP.NET NUnit test runner is a simple utility to allow running your NUnit tests inside your ASP.NET application. This is used to allow testing inside an HttpContext without the hassles and pitfalls of trying to fake the context for a test.

I use this test runner on my Sitecore projects to allow unit testing inside the Sitecore application.

Download

The test runner is distributed as a test project to be included in your solution.

Custom ASP.NET NUnit Test Runner 1.1 (121k)

Usage

The test runner loads tests from it's own assembly. So make sure you write your tests inside the same project that the ASPX codebehind is compiled in. The test runner also provides a category filter. Attribute your test fixtures with a CategoryAttribute attribute to allow filtering for your test fixture.

Deployment

Once built, just deploy the aspx file under the webroot of your ASP.NET application and the dll to the bin folder.