Advanced Techniques with NUnitAsp
Advanced Techniques with NUnitAsp
Submitted by webmaster@testdriven.com (Links) on Thu, 27/01/2005 - 23:13. .NET | test driven developmentKeeping bugs out of existing code during new development has always been a huge problem. However a new methodology, Test Driven Development (TDD), is helping to change that. The two main principles of this methodology are: 1) Never write a single line of code unless you have a failing automated test, and 2) Eliminate duplication.
In principle this makes sense - we'd all love to have a thousand automated tests, running at the click of a button or command line, which guarantees that our application works. There's even a popular open source tool, NUnit, which provides a framework for running automated unit tests. While this is very popular with class libraries that just manipulate data structures, it is much more difficult with GUIs.
Fortunately there's another open source tool, NUnitAsp, which provides a framework to test the GUI's aspx pages. NUnitAsp is an NUnit extension that provides the extra classes needed to test the HttpContext used by WebForms. Therefore within your NUnit tests, you could load up a page just as a user would see it, taking into consideration the QueryString, Session, ViewState, postback, Web.config, etc... You could then programmatically trigger events and check the resulting properties. This opens up a whole new world for testing techniques.
Author: Tim Stall
Published: January 26, 2005
In principle this makes sense - we'd all love to have a thousand automated tests, running at the click of a button or command line, which guarantees that our application works. There's even a popular open source tool, NUnit, which provides a framework for running automated unit tests. While this is very popular with class libraries that just manipulate data structures, it is much more difficult with GUIs.
Fortunately there's another open source tool, NUnitAsp, which provides a framework to test the GUI's aspx pages. NUnitAsp is an NUnit extension that provides the extra classes needed to test the HttpContext used by WebForms. Therefore within your NUnit tests, you could load up a page just as a user would see it, taking into consideration the QueryString, Session, ViewState, postback, Web.config, etc... You could then programmatically trigger events and check the resulting properties. This opens up a whole new world for testing techniques.
Author: Tim Stall
Published: January 26, 2005
