Testing Silverlight Asynchronous Code
Coming! Version 1.7 will also support testing Silverlight asynchronous code with the help of the Silverlight Unit Test Framework. You can read about the background Ryan's post.
The facts (please consider them as beta):
Configure Specflow project to use async testing
<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow"/> </configSections> <specFlow> <unitTestProvider name="MSTest.Silverlight4" /> <generator generateAsyncTests="true" /> </specFlow> </configuration>
Use async operations from your step bindigns
The async support provides you several API methods for doing that.
continueUntilpredicate that must return true before the work queue is continued.
For accessing these API methods, you have two options currently.
- Derive your step binding class from
TechTalk.SpecFlow.Async.AsyncStepsand use the methods inherited from the base class.
AsyncContext.Currentto access the API methods.