After years of unofficial hacks to get xUnit working for Windows Store apps, I’m happy to announce that xUnit v2 beta 4 ships with official support. As an added bonus, Windows Phone App 8.1 support is included as well.

To use xUnit for Store, you need the latest xUnit.net runner for Visual Studio installed.

Steps to create a Windows 8 Store Unit Test for xUnit:

  1. Install the runner
  2. Create a new Windows Store Unit Test project
  3. In the project references, remove the MSTestFramework reference and delete the UnitTest1.cs sample test
  4. Use NuGet to Install-Package xunit -Pre and install at least version 2.0.0-beta4-build2738
  5. Create your tests
  6. When you compile, you’ll see the tests in the Test Explorer window (make sure to show that window if it’s not visible)

Steps to create a Windows Phone App Unit Test for xUnit:

  1. Install the runner
  2. Create a new Windows Phone App Unit Test project (not Windows Phone 8.1 Silverlight)
  3. In the project references, remove the MSTestFramework reference and delete the UnitTest1.cs sample test
  4. Use NuGet to Install-Package xunit -Pre and install at least version 2.0.0-beta4-build2738
  5. Create your tests
  6. When you compile, you’ll see the tests in the Test Explorer window (make sure to show that window if it’s not visible)

To Do

  • Windows Phone 8 support – technical issues to overcome
  • Project Templates

Limitations

Right now, only Any CPU/x86 is supported by the VS Runner due to limitations in the VS Runner’s extensibility model. We plan on shipping a device runner, similar to the Xamarin Runner that will enable on-device ARM testing.

I’d like to thank @bradwilson and @jamesnewkirk for their patience and persistence with merging these large pull requests and keeping the release bar so high.