Silverlight and unit testing..

A while ago i was looking for a unittesting framework that can be used with Silverlight. Because i don’t want to launch a webbrowser on my buildserver i ruled the Unit Test Framework for Microsoft Silverlight out. A couple of websearches later i decided to try a Silverlight port of good ol’ NUnit, nunitsilverlight, and was pretty pleased with results.

A couple of things to keep in mind though:

  • Make sure your test runner loads the correct System assembly (Possible solution: set Copy Local to true in your test project)
  • In case your test runner has to run tests in both ‘regular’ and ‘silverlight’ assemblies, make sure that your runner uses separate AppDomains (For NUnit use the /Domain=Multiple option)
  1. I created StatLight for our continuous integration needs. You can check it out at http://www.statlight.net.

    StatLight will run the tests in the browser, where it can give you a true representation of what is actually going to happen in the browser. StatLight will also work with NUnit if you wish.

    Happy Testing!

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>