Unit Testing the GUI

December 2nd, 2005

Following up on a recent posting from Doug regarding unit testing and gui unit testing, I came across NUnitForms today.

According to its designers:

Your NUnit tests can open a window and interact with the controls. Your tests will automatically manipulate and verify the properties of the gui. NUnitForms takes care of cleaning up your forms between tests, detecting and handling modal dialog boxes, and verifying that your expectations for the test are fulfilled….

Support is currently provided for Buttons, CheckBoxes, ComboBoxes, Labels, ListBoxes, RadioButtons, TabControls, TextBoxes, TreeViews, Context Menus, Forms, MenuItems, Modal Forms, Modal MessageBoxes, and the Mouse. If your control is not specifically supported, you can still test it using the “ControlTester” class. It has helpful methods and properties that use reflection to work on any control. …

NUnitForms also provides a Recorder application that can record your interactions with a form and “write” a test for you that duplicates your actions. You can perform asserts during this process by right-clicking on your controls and selecting the property to assert…

Haven’t checked it out extensively, but looks pretty cool at first glance.

Comments are closed.