Welcome to MSDN Blogs Sign in | Join | Help

Unit testing with Silverlight

image One of the things I was most excited about when we shipped the Silverlight 2 Beta 1 controls was the included unit testing harness, written by Jeff Wilcox.  I think it's a good thing when we can share some of our internal tooling.  It's good for customers, because they can leverage the work that we've been doing, and it's good for people here because it gives them a chance to "ship" something and get some visibility in the industry.  And this is definitely the case with the Silverlight Unit Test Framework, which Jeff has just updated for RC0.

This is the exact package that we're using internally to run our automated unit tests and we've been adding features to it as our team grows.  Oftentimes, development teams here at Microsoft use a different testing harness from what the testing teams use (please don't ask...) and I'm keen to avoid that setup, and the Silverlight Unit Test Framework provides the functionality for both.  And that we're allowing customers to leverage it opens up some other possibilities that I'll get into later.  Note that the Silverlight Unit Test Framework is an unsupported toolset, not an official Microsoft product.

Some of you may be asking why we wrote our own unit testing harness instead of using something like nUnit or MbUnit.  The main reason is because the existing offerings were all written against the full .NET Framework.  Even though Silverlight is .NET code, it really is a different platform.  And it has some special needs due to the constraints on the type of reflection you can use (public only) and how you're able to instantiate and discover tests.  So we decided we needed a harness that was written fully in Silverlight and hosted the tests directly in the harness itself.  This has worked out well.

So if you're starting to get rolling with Silverlight, and you want to do some unit testing, definitely give the Silverlight Unit Test Framework a look.

More details here.

Published Tuesday, September 30, 2008 8:57 PM by sburke
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Unit testing with Silverlight : EasyCoded

Tuesday, September 30, 2008 4:18 PM by Unit testing with Silverlight : EasyCoded

# Silverlight Controls, Controls Team, and Testing

This blog will rarely be the place for breaking news, but there are two related pieces of information

Saturday, October 04, 2008 7:58 PM by Jesse Liberty - Silverlight Geek

# Silverlight Controls, Controls Team, and Testing

This blog will rarely be the place for breaking news, but there are two related pieces of information

Saturday, October 04, 2008 8:13 PM by Microsoft Weblogs

# Silverlight Controls, Controls Team, and Testing

This blog will rarely be the place for breaking news, but there are two related pieces of information

Saturday, October 04, 2008 8:37 PM by Mirrored Blogs

# re: Unit testing with Silverlight

A colleage of mine created a ReSharper plugin for running Silverlight Unit Tests directly from Visual Studio. Check it out. It's saving us a lot of time, while running tests.

http://www.ingebrigtsen.info/post/2008/09/21/Silverlight-UnitTest-runner-for-Jetbrains-ReSharper.aspx

Sunday, October 05, 2008 4:01 PM by Roy Tore

# Silverlight 2 Released - Silverlight Toolkit on the Way

As you know, today we released Silverlight 2 .  Scott mentioned the Silverlight Toolkit in his post

Tuesday, October 14, 2008 1:32 PM by Shawn Burke's Blog

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker