My Silverlight Testing Rig

Shout it kick it on

I was recently asked by someone on Twitter to describe my setup for writing tests against my Silverlight application.  I thought I would write them down here in case others might find this information useful.

Testing Framework: A slightly modified version of NUnit that works with SIlverlight.

Mocking Framework: Moq 3.0 includes support for Silverlight.  This is my favorite mocking framework, so I am happy that it now supports Silverlight.

Test Runner: I use TestDriven.NET to run all of my tests locally.  I use Cruise Control to run the tests on the “Continuous Integration” system.

Making testing easier: This is not specific to Silverlight testing, but I use ReSharper templates that I have customized to aid in writing tests quickly.

The MVVM Pattern: This is not a tool, but I the majority of my SIlverlight code would be un-testable if I didn’t know the MVVM pattern.  I highly recommend using this pattern with Silverlight.  None of the view code can be tested using NUnit, so testing the ViewModel is essential.

UI Automation: I am just starting to play with this.  White is a layer on top of Microsoft’s UI Automation (UIA) framework.  UIA is much to hard to use without a “helper” layer.  It lets you run fully automated UI tests.  I only want to use this to make sure my data bindings are correct.  My unit tests are really the bulk of my testing efforts.

Leave a Reply