Testing with Launchers and Choosers

Unit testing code that uses a launcher or chooser directly is a challenge because both types of tasks cause your app to be deactivated. No means to abstract launchers or choosers exists out-of-the-box; therefore, I have included in the downloadable sample code a set of classes that do just that.

Just as we abstracted the built-in LicenseInformation class in the previous section, here we do the same with the MarketDetailTask. The MarketDetailTask is a launcher which, when shown, takes the user to the built-in marketplace application. When showing the MarketplaceDetailTask during a debugging session, the native marketplace application displays an error because it expects an app with an id that has been officially ...

Get Windows® Phone 8 Unleashed 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.