Compact Framework Unit Testing via Microsoft.VisualStudio.TestTools.UnitTesting

Sep 21, 2009 at 8:21 PM

Device: HP iPAQ 110 Classic Handheld
OS: Windows Mobile 6 Classic
Framework: .Net Compact Framework 3.5 / C#
Dev Tools: Microsoft Visual Studio 2008

I want to write Unit Test suite my .netcf 3.5 C# application. It must run on device and display results on a form. I tried added Form to Test Project but it does not work. How does one setup to do this? I am using Microsoft.VisualStudio.TestTools.UnitTesting.


Oct 16, 2009 at 3:42 PM

Sorry for the huge delay.

To be honest, I cannot completely follow your question. However, I'll try to help you and let me know if I've missunderstood anything.

First of all, if you're creating a new Unit Testing project using the default project template from Visual Studio 2008, it's not targeting a mobile device. For doing that, you can start from a .Net CF project by right clicking on a class code window and select "Create Unit Test".

As an alternative, I've posted a project template in my blog:

Either using the first approach, or the project template one, you won't have the unit testing results on a form running on your device. The smart device Unit Testing projects publishes the results on the Test Results windows, as a regular Unit Testing project, and it requires the device connected to your desktop, to see the results.