views:

32

answers:

2

Hi all,

I have Framework2.0 already installed in device, I have created a unit Test project for the smartDevice application, now to test this project I need to have Device Unit Test Framework installed in the machine. http://msdn.microsoft.com/en-us/library/bb545998.aspx

Here I want to know if Device Unit Test Framework is distributed independently. I tried to find it out but no luck. I am not fine with installing complete .net Compact Framework 3.5 just to run the unit test project because my application ( for which unit test project is created) is using .net framework 2.0 only.

Can any body tell me. If VS2005 provides Unit testing functionality of DEVICES.

+1  A: 

The Device Unit Test Framework also supports .NET Compact Framework 2.0, so you're fine there.

Please read this article to see how to configure and run the unit tests on your device.

tomlog
This is showing just, how to debug the code while unit testing the device.
Sumeet
+1  A: 

I do a lot of Compact Framework development and I would suggest an alternative to use the Smart Device Unit Testing.

Refactor your code so that your UI is just a View. (Ie it does nothing but call other classes.) Then put your non-UI classes under Unit test. (Just normal unit tests.)

Visual Studio will give you a warning when you first create the normal unit test project, but after that it is smooth sailing.

There are 3 reasons for doing this:

  1. Speed. It takes a lot less time to run your unit tests this way.
  2. Ease. As you have seen, getting the smart device unit testing up and working takes a bit
  3. Compatibility. By doing this you get access to tools like Rhino Mocks.

Now the drawback:

  1. You are not "really" testing your code in the NETCF environment.

While the drawback is significant, unit tests are not a substitute for "real" testing which would quickly catch any issues that would be missed by that drawback.

Vaccano
+1 - Solid answer.
Mat Nadrofsky