Developing on Staxmanade

xUnit (Light) for Silverlight

If you've been doing any Silverlight development, I'm sure you're aware of the Microsoft Silverlight Unit Test Framework.

One extremely interesting aspect about this framework is how flexible it is for custom extension. If you didn't already know, Jeff Wilcox put together a quick port of NUnit and created a project that would interface the nunit.framework.dll he ported with the Microsoft Silverlight Unit Test Framework. (post here)

Below I'll explain a little about my port of the xUnit testing framework that is now hosted in the browser leveraging the Microsoft Silverlight Unit Test Framework.

As far as WHAT is implemented with the xUnit for Silverlight and what you may have to figure out on your own (as I'm not all that familiar with xUnit) if you use it for your own project...

  1. FactAttribute ( obviously )
  2. FactAttribute.Skip ( [Ignore] in most frameworks )
  3. FactAttribute.Name (is mapped to the "Description" in the ms test harness)

That's pretty much it... It doesn't do anything as far as test Setup/Teardown as Moq (the project I needed xUnit in Silverlight for) didn't need it, and because I'm not familiar enough with xUnit to really make this thing fully compatible.

So, here is XunitLight for Silverlight...

UPDATE: (2/9/2009) If you'd like to provide any updates to this project. You can get the source from below and I'm happy to take a look at patches...
http://svn.xp-dev.com/svn/staxmanade_projects/XunitLight.Silverlight/

Comments

Jason.Jarrett
Hey Jonathan,

Personally I'd like to see it built straight into xUnit, since it's dependent on the xUnit source files. There's a work-item to support silverlight on the xunit site, and a link to my blog, so hopefully someone over on xUnit team will get a kick and look a porting it for everyone...

Also, I don't use xUnit personally, and only wrote this quickly to get the tests to work while trying to port the Moq project.

However if you or someone else gets it up and running w/ either xunit or xunit-contrib, I'll surely remove my svn version.
Jonathan Harley
Hey man,

Why not add this to xUnit Contrib?

Or have I just missed you doing that already?