windows phone

Announcing: xUnit Device Runner RC1

January 31, 2015 Coding 1 comment , , , ,

xUnit Device Runner 1.0 RC1

I’m pleased to announce the release of the xUnit Device Runners Release Candidate 1. This release adds support for the Xamarin.iOS Unified profile, required for all new iOS applications now and updates starting in July.

Other notable enhancements include a filter for searching test cases by name and status (pass/fail/not run).

To get started, please see the following posts:

If you run into any issues, please file a report in the issue tracker.

Now available: xUnit for Windows Phone 8 Silverlight

November 21, 2014 Coding 1 comment ,

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

  1. Read the post on getting started with Xamarin. It’s almost identical.
  2. Use the latest version of the runner, 0.99.5-beta5 at the time of this writing.
  3. When creating the WP8 App, use the Windows Phone 8 Silverlight (Blank) template.
  4. Replace the contents of MainPage.xaml.cs with the contents of MainPage.xaml.cs.txt added to your project

To run tests, simply run the app either in the debugger or deploy and run.

Known issues

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 🙂

How you can help

Pull requests are very much welcome over at the project site. If you need help getting up-and-running, just ping me on Twitter.

Now Shipping: xUnit support for Windows 8 and Windows Phone App 8.1

August 11, 2014 Coding 2 comments , ,

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.