This is a tiny experiment to automate parts of unit testing in Windows Phone 7.5 (Mango, here onwards). We will extend silverlight unit testing framework to store the results of a Mango unit test in MSTest test results format in application Isolated Storage and finally fetch them onto desktop.
Assuming you've Mango tools setup already. Get Mango compatible SL unit testing framework bits from Jeff's [blog](http://www.jeff.wilcox.name/2011/06/updated-ut-mango-bits/). Sample project is available [here](https://github.com/codito/wpsamples/tree/master/SLUnitTest.IsoStore). Setting it up.. --------------- - Add [IsolatedStorageReportingProvider.cs](https://github.com/codito/wpsamples/blob/master/SLUnitTest.IsoStore/PhoneApp.Test/IsolatedStorageReportingProvider.cs) to your test project - Wire it up with the UnitTestHarness in your application entry page (see my [MainPage.xaml.cs](https://github.com/codito/wpsamples/blob/master/SLUnitTest.IsoStore/PhoneApp.Test/MainPage.xaml.cs)). By the way, Silverlight Unit Test framework [code](http://silverlight.codeplex.com/SourceControl/changeset/view/69081#976050) is available on codeplex. Feel free to explore :)</p>
<div class="CodeRay">
</p>
<div class="code">
</p>
// Set custom log writerIsolatedStorageReportingProvider isoLog = new IsolatedStorageReportingProvider(((MobileTestPage)testPage).UnitTestHarness.Settings.TestService);((MobileTestPage)testPage).UnitTestHarness.Settings.TestService.RegisterService(Microsoft.Silverlight.Testing.Service.TestServiceFeature.TestReporting, isoLog);// Uncomment this to automatically terminate the test application after test is complete!//isoLog.LogPublished += new EventHandler(this.OnTestHarnessCompleted);(Application.Current.RootVisual as PhoneApplicationFrame).Content = testPage;
</div>
</p>
<p>
</div>
</p>
<p>
-
Fire up
[ISETool.exe](http://msdn.microsoft.com/en-us/library/hh286408.aspx)
to get the results onto desktop