views:

38

answers:

1

Is there any way to test a Windows Phone 7 Class library? Usually (for WinForms or WPF applications) I create separate class library and add reference to nunit.framework.dll and to a class library which I want to test.

Here, if I create new Windows Phone class library it doesn’t allow me to add reference to NUnit framework assembly.

If I create usual Class library, it obviously allows me to refer to NUnit, but doesn’t allow to add reference to the Windows Phone Class library that I want to test. Closed loop :)

Any ideas on how I can perform my unit-testing?

UPD: I think that there is no proper solution yet. There is one raw hand-made solution(that is not even in alpha) http://wptestlib.codeplex.com/. UnitDriven and Silverlight Unit Test Framework can be used unless you want to test something device specific. I.e. it is impossible to refer WP7 specific assemblies in these projects.

+1  A: 

Check out Unit Driven or the Silverlight Unit Test Framework.

JP Alioto
Hi JP. THank you Unit Driven is good. BUT it doesn't provide testing engine. There is UI for tetsting in Silverlight, and with some restrictions it can be used for testing #wp7 applications. in this case we need to create web-based silverlight application, refer to class library which we want to test, write tests and run it. It works perfectly unless we use #wp7 specific classes for testing. For instance I'm using System.Device.GeoCoordinate class and I still can't add reference to it to Silverlight application.
Bashir Magomedov
So I need something that was originally created for #wp7 and doesn't have compatability issues.
Bashir Magomedov
I have try to use the Unit test but failed too,I guess that we have to wait for the Microsoft'Actions
magicshui