This is a mirror of official site: http://jasper-net.blogspot.com/

Silverlight Unit Test For Phone

| Wednesday, March 9, 2011
There has been some confusion about how to make the Silverlight Unit Tests work on Windows Phone.  The latest release of the Silverlight Unit Tests comes with the Silverlight Toolkit, and it targeted at Silverlight 4.  Windows Phone is based on an enhanced version of Silverlight 3 and cannot use these DLLs.

Fortunately, Jeff Willcox has made the right DLLs available on his web site.

Silverlight 3 binaries for the Silverlight Unit Test Framework

You will need to ‘unblock’ the zip file before unpacking the files. These binaries are strong named, but are not Authenticode signed, so they are not official

To get started, follow these steps:
  • Make sure Visual Studio 2010 is installed
  • Download, unblock and install the Silverlight Unit Tests
  • Create a new Windows Phone project
  • Add references to the two DLLs
  • Microsoft.Silverlight.Testing
  • Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight

Be sure to put the unit tests inside the same project as the project you are testing, though it is good programming practice to isolate the tests in their own folder and namespace.
Be sure to add using statements in each file that must recognize the testing framework (certainly in mainpage.xaml.cs) for the two DLLs

using Microsoft.Phone.Controls;
using Microsoft.Silverlight.Testing;

Read more: Jesse Liberty

Posted via email from Jasper-net

0 comments: