Reputation: 3555
For my current project I develop a GUI that is used for configuring a server. The GUI is using some services to run commands.
Did you ever developed unit tests for a GUI client? Can you suggest me some architectural approaches in order to have my project unittestable?
Thanks, Radu
Upvotes: 0
Views: 155
Reputation: 136663
I don't write unit tests for GUI clients. GUIs make my tests slow.
Instead split your client into a GUI skin on top of a set of classes. Search for PresentationModel or MVVM patterns for more information. Once you've done that, you can write (listed in decreasing order of speed and volume)
Upvotes: 1
Reputation: 2206
Hey.
For 'desktop' application use White to test GUI from unit test framework. For web app use Watin.
Upvotes: 1
Reputation: 3299
Besides the possibility of "gui-testing" your application with different tools that are developed for that, I would recommend using some passive view patterns like MVP for WinForms or MVVM(P) for WPF. By this way almost all intelligence is in the presenter, and by mocking away the view you can test it pretty well.
Upvotes: 1