I want to generate a unit test on my wp7 app.
So I go to vs2010 -> test -> new basic unit test.
vs2010 generates a new test project in my solution, and I want to start coding. Now the problems begin.
How do I make the classes and methods from my wp7 app project accessable? When I add a reference to the app in my test project, it does not help me, because I get:
Warning 2 The project 'foo' cannot be referenced. The referenced project is targeted to a different framework family (Silverlight)
What should I do?
You need to use the Silverlight Unit Test framework:
http://channel9.msdn.com/Events/MIX/MIX10/CL59
Then you use Jeff Wilcox’s unit test runner, which is a phone app:
http://blogs.msdn.com/b/amit_chatterjee/archive/2011/06/26/unit-testing-the-windows-phone-7-applications.aspx
I do this with success.