End of NUnitAsp Development
31 January 2008
I'm making it official: I am no longer maintaining or supporting NUnitAsp.
That project ended years ago, but I kept NUnitAsp alive, even though I haven't written any ASP.NET code for a long time. The NUnitAsp v2.0 release last year was my last attempt to fill in the big holes. Now it supports multiple forms, has a simpler syntax, and it tests HTML as well as ASP.NET server-side components.
Despite these flaws, I think NUnitAsp is an interesting tool. I'm proud of the code and the API. If nothing else, it's a good example of what a dedicated agilist will do when faced with a brand-new platform: he finds a way to unit test it.
If you would like to take over development of NUnitAsp, and you have name recognition in the community, I will be happy to hand it over to you. If I don't recognize you, feel free to fork the code. When your fork is successful, let me know, and I will give you the keys to the "official" project. NUnitAsp still gets between one and two thousand downloads per month, so it's not quite dead yet.
Thanks for your interest in NUnitAsp and in sticking with me over the years. I'm not going away, of course--I just have other projects that are occupying my time. I write about them at jamesshore.com.
NUnitAsp is a tool for automatically testing ASP.NET web pages. It's an extension to NUnit, a tool for test-driven development in .NET.
Once you have an automated suite of tests, you'll never go back. It gives you incredible confidence in your code. That confidence allows you to code much faster, because you can make risky changes secure in the knowledge that your tests will catch any mistakes.
NUnitAsp is freely available under the MIT license.
How It Works
NUnitAsp is a class library for use within your NUnit tests. It provides NUnit with the ability to download, parse, and manipulate ASP.NET web pages.
With NUnitAsp, your tests don't need to know how ASP.NET renders controls into HTML. Instead, you can rely on the NUnitASP library to do this for you, keeping your test code simple and clean. For example, your tests don't need to know that a DataGrid control renders as an HTML table. You can rely on NUnitAsp to handle the details. This gives you the freedom to focus on functionality questions, like whether the DataGrid holds the expected values.
Simply speaking, NUnitAsp makes it very easy to unit test ASP.NET web pages.
public void TestExample()
// First, instantiate "Tester" objects:
LabelTester label = new LabelTester("textLabel");
LinkButtonTester link = new LinkButtonTester("linkButton");
// Second, visit the page being tested:
// Third, use tester objects to test the page:
Assert.AreEqual("Not clicked.", label.Text);
Assert.AreEqual("Clicked once.", label.Text);
Assert.AreEqual("Clicked twice.", label.Text);
NUnitAsp can test complex web sites involving multiple pages and nested controls. The common ASP.NET controls are supported (see complete list below), and support for additional controls is easy to add.
Latest Release: Version 2.0
Version 2.0 is a major update. Most significant changes:
- Tests ASP.NET 2.0 pages.
- Works with any version of any testing framework.
- Supports multiple forms.
- Tests can directly modify form variables, submit forms, and post-back forms.
- Added a boatload of new testers, including a generic tester for any HTML tag.
- Supports using XPath to find HTML tags.
- Removed need to use CurrentWebForm parameter.
- Added Advanced NUnitAsp video.
Controls supported in this release:
generic HTML tag tester(new!)
Credits and History
James Shore created today's NUnitAsp while leading a team creating a commercial web application in the beta days of ASP.NET. Unwilling to develop without the safety net of test-driven development, he took over Brian Knowles' open-source application for testing ASP.NET and updated it to support full TDD of ASP.NET code-behind. Since releasing the first version of NUnitAsp on SourceForge in 2002, he's seen it grow into an application that's downloaded thousands of times every month.
Since the original release, dozens of people have contributed time and effort to NUnitAsp. Of particular note is Levi Khatskevitch, who joined the team in November 2003 and coordinated the integration of patches and contributed many new features and improvements to version 1.4 and 1.5. For a complete list of contributors, see our change log.
In 2006 and 2007, NUnitAsp languished as James turned his attention to other projects. The v2.0 release, published in June 2007, will be the last release James produces. He is looking for someone else to take over; if you would like to do so, please post to the nunitasp-devl mailing list.
Last updated for v2.0.