R – Automated Silverlight Unit Testing with CruiseControl.NET

cruisecontrol.netsilverlightunit testingvisual-studio-2008

What is currently the best solution to automate running unit tests against silverlight applications within CruiseControl.NET?

Preferably I would like to run MSTest unit tests however as these aren't officially supported for silverlight yet I am open to suggestions that use other testing frameworks.

Best Answer

The November version of the Silverlight Toolkit contains not only the Silverlight Unit Testing Framework, but also an MSBuild task to allow the framework to be run from the command line. See Jeff Wilcox's post for detail, but you essentially end up doing this:

msbuild /t:test /p:browser=firefox

As CC.Net can run MSBuild you should be able to at least call the tests. The output is in TRX format.

I've used this framework with some success, although not integrated into CC.Net, it works fine but the tests run in a browser so are a little slow. The advantage of running in the browser is you can do more acceptance-like tests, running up controls to display. The framework also includes methods to cope with the asynchronous nature of Silverlight.

Related Topic