xunitcontrib-silverlight 0.2

Rating: No reviews yet
Downloads: 392
Change Set: f2b5953e4631
Released: Mar 16, 2011
Updated: Mar 16, 2011 by mattellis
Dev status: Beta Help Icon

Recommended Download

Application xunitcontrib-silverlight.0.2.zip
application, 1382K, uploaded Mar 16, 2011 - 392 downloads

Release Notes

This release is a port of xUnit.net to Silverlight together with a provider to run xunit tests in Microsoft's Silverlight Unit Testing Framework. It is a port of xUnit.net 1.6.1 and targets Silverlight 3 and 4 and Windows Phone 7, and is based on the April 2010 release of the Unit Testing Framework.

This is the initial release. While not a complete port of xUnit.net, it contains the majority of functionality required day to day (i.e. Fact and Theory based tests are fully supported). It should be considered to be beta quality.

This release adds Windows Phone 7 support, plus a number of bug fixes and improvements in quality (such as reliable version numbers!)

Installation notes

Please be sure to "unblock" the downloaded zip file! (Right click -> Properties -> Unblock)

The easiest way to get started is to install the April 2010 Silverlight Toolkit. This adds a Silverlight Unit Test Application project template to the new project dialog in Visual Studio.

For Silverlight 4

  1. Create a new Silverlight Unit Test Application project
  2. Add a reference to the following files from the Silverlight4 folder in the zip file:
    • xunit-silverlight4.dll
    • xunit.extensions-silverlight4.dll
    • xunitcontrib.runner.silverlight.toolkit-silverlight4.dll
  3. IMPORTANT: In the App.xaml.cs file, before the call to UnitTestSystem.CreateTestPage add a call to UnitTestSystem.RegisterUnitTestProvider(new XunitContrib.Runner.Silverlight.Toolkit.UnitTestProvider()). If this step is missed, no tests will be found!
  4. Add [Fact] based tests and run the app

For Silverlight 3

  1. Create a new Silverlight Unit Test Application project
  2. In the project properties page, change the Target Silverlight Version from 4 to 3
  3. Remove the references to Microsoft.Silverlight.Testing.dll and Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll (these are the Silverlight 4 versions)
  4. Add a reference to the following files from the Silverlight3 folder in the zip file:
    • Microsoft.Silverlight.Testing.dll (the Silverlight 3 version)
    • xunit-silverlight3.dll
    • xunit.extensions-silverlight3.dll
    • xunitcontrib.runner.silverlight.toolkit-silverlight3.dll
  5. IMPORTANT: In the App.xaml.cs file, before the call to UnitTestSystem.CreateTestPage add a call to UnitTestSystem.RegisterUnitTestProvider(new XunitContrib.Runner.Silverlight.Toolkit.UnitTestProvider()). If this step is missed, no tests will be found!
  6. Add [Fact] based tests and run the app

For Windows Phone 7

Follow along with this blog post
  1. Create a Windows Phone application
  2. Add references to
    • Microsoft.Silverlight.Testing.dll (Silverlight 3 version - included in release)
    • xunit-silverlight-wp7
    • xunit.extensions-silverlight-wp7
    • xunitcontrib.runner.silverlight.toolkit-wp7
    • Visual Studio may display warnings about including Silverlight 3 assemblies. Ignore it, these are the right files
  3. In the MainPage.xaml.cs file, modify MainPage_Loaded to create the test page and set it as the RootVisual (see the above link for more info)
  4. IMPORTANT: Ensure you register the unit test provider with a call to XunitContrib.Runner.Silverlight.Toolkit.UnitTestProvider.Register(). If you do not call this, NO TESTS WILL RUN
  5. Add [Fact] based tests and run the app

Reviews for this release

No reviews yet for this release.