10.11 Unit Testing Your GUI with NUnitForms

Unit testing and test-driven development are increasingly being used to improve software reliability and simplify code design. However, it remains less common for developers to write unit tests for the user-interface components of their applications. NUnitForms, originally developed by Luke Maxon, makes it easy to test this part of your application. The API allows you to interact with your Windows Forms and control classes from a unit-test suite, verifying their proper behavior, state, and interactions.

NUnitForms at a Glance

Tool

NUnitForms

Version covered

1.3, 2.0 beta

Home page

http://nunitforms.sourceforge.net

Power Tools page

http://www.windevpowertools.com/tools/37

Summary

Makes it easy to write automated unit tests for your Windows Forms and control classes

License type

BSD

Online resources

Unit-test examples, forums, bug tracker, mailing list

Supported Frameworks

.NET 1.1, 2.0

Related tools in this book

NUnit

Getting Started

NUnitForms is a standalone testing framework. You don’t need any other test framework.

Source and binary downloads are available from the Download link at the tool’s home page. To use the binaries, simply run the installer or copy the supplied .dll files into your project’s library directory. Reference NUnitForms.dll from your unit-test project, and then you can write and execute unit tests in the usual way.

Here is an example of ...

Get Windows Developer Power Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.