Recipe 27Test on Windows Phone

Problem

You want to test a Windows Phone app using Cucumber syntax.

Ingredients

  • Visual Studio Professional 2010 Service Pack 1[172] or newer

  • The Windows Phone SDK 7.1[173]

  • The Windows Phone Test Framework[174] by Expensify

  • SpecFlow[175] for parsing Cucumber syntax

  • NUnit[176] to run the tests

  • The NuGet package manager[177] to install the testing tools

Solution

Writing Cucumber-style tests for Windows Phone involves orchestrating a few different pieces that work together. A test runner starts and stops the test. SpecFlow parses your plain-English test steps and matches them to your C# step definitions. A server embedded into your app listens for incoming commands and simulates screen taps.

The Windows Phone Test Framework ...

Get Cucumber Recipes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.