I want to run unit and integrated tests for my windows phone 7 application.But The library which has been provided by jeff wilcox and code from http://smartypantscoding.com/a-cheat-sheet-for-unit-testing-silverlight-apps-on-windows-phone-7 run through emulator.
But I want to run individual tests in the same way any windows application runs e.g by right clicking on individual tests in a test class .. also if soemone wants to run the tests through the command line without invoking the sdk.
But the unit testing framework which is currently available runs through emulator.
With some good separation of concerns and some limitations, you can execute your tests using the Silverlight runtime. Once this is configured you can run your tests using ReSharper+AgUnit or TestDriven.net in VS and Statlight from the commandline.
You can read about the setup instructions on a blog post I wrote up but for the sake of keeping information on SO, I’ll summarise here:
Reference Microsoft.Silverlight.TestingandMicrosoft.VisualStudio.QualityTools.UnitTesting.Silverlightfrom the Silverlight (not WP) toolkit%programfiles%\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71and setCopy LocaltotrueThe limitations include:
Microsoft.Phone.*)If you can deal with all that (I still haven’t decided if it’s worth it) it can provide a pretty quick test cycle, and the in-emulator tests can still be run for anything that sits outside the limitations.
What we really need is the emulator supporting a fast, headless mode (in-emulator tests is way more compatible) and some kind of Gallio adapter.