With the release of xUnit 2 beta 5, Windows Phone 8 Siverlight is now supported; here's how to get started.
Side note: If you've previously had the xUnit Extension VSIX installed, you need to remove it for beta 5. You no longer need it. See the release notes for details.
Unfortunatey, due to limitations in the Visual Studio Test Explorer's architecture, we can't yet integrate into the Test Explorer window like we can for Universal or Dekstop apps. Instead, we have to run the unit tests as an app on the device, exactly like we do for Xamarin. In fact, with Xamarin Forms providing the UI, we're able to bring the same runner support to WP8.
Steps to create a Windows Phone 8 Silverlight test project
- Read the post on getting started with Xamarin. It's almost identical.
- Use the latest version of the runner,
0.99.5-beta5at the time of this writing.
- When creating the WP8 App, use the
Windows Phone 8 Silverlight (Blank)template.
- Replace the contents of
MainPage.xaml.cswith the contents of
MainPage.xaml.cs.txtadded to your project
To run tests, simply run the app either in the debugger or deploy and run.
The Xamarin Forms-based runner is bare bones. It needs a lot of work to add features. But it does work to execute xUnit tests and run them in a debugger to figure out why stuff's not working 🙂