User Interface Testing

There are GUI testing tools that will click buttons and stuff for you but they're pretty fragile in my experience.

The best thing to do is to keep your UI layer as thin as possible. Your event handler classes should optimally be only one or two lines that call out to other more testable classes. That way you can test your business logic in unit tests without having to actually do a button click.


In the event that someone finds this useful:

List of GUI testing tools found on Wikipedia.


Keep the GUI layer as thin as possible. Michael Feathers article, The Humble Dialog Box, is a classic. Also check out Martin Fowler's Passive View. I have also heard that the "automatic button clickers" are fragile, and that it's easy to spend more time maintaining the test than you spend maintaining the code.


You can automate GUI testing using White framework.

Also consider using TDD friendly design, i.e. use MVP/MVC pattern.

I would highly recommend you to read documentation from Microsoft patterns&practies teams.

Especially have a look at the Composite UI application block and CompositeWPF.

These projects specifically designed to give you best practices in GUI apps development including test driven UI.