Monday, May 16, 2005
Question:
Do Smart Device Projects (i.e. Compact Framework projects) support unit testing as offered by Visual Studio 2005?
Investigation:
1. In a CF project write the following method:
3. Set the newly created project as startup project (via context menu)
4. Go to the test method and change the following line:
to
5. Comment out the Assert.Inconclusive line
6. Run the project
7. Observe: The PPC emulator starts, which is promising, but unfortunately the unit test passes :-(
It would not pass if it was running against the CF, as the build number is 5056 (the full framework build number for Beta 2 is 50215).
Conclusion:
Unit testing is not supported by CF projects and instead the tests get retargeted to the full framework (much like Deploy to My Computer).
Link:
For an open source project that supports unit tests running on the device, see CFNUnitBridge from Trey
Do Smart Device Projects (i.e. Compact Framework projects) support unit testing as offered by Visual Studio 2005?
Investigation:
1. In a CF project write the following method:
public Int32 GetBuildVersionPart(){
return System.Environment.Version.Build;
}2. Right click on the method and choose "Create Tests...", choose C# and OK, choose default name and OK3. Set the newly created project as startup project (via context menu)
4. Go to the test method and change the following line:
int expected = 0;to
int expected = 50215;5. Comment out the Assert.Inconclusive line
6. Run the project
7. Observe: The PPC emulator starts, which is promising, but unfortunately the unit test passes :-(
It would not pass if it was running against the CF, as the build number is 5056 (the full framework build number for Beta 2 is 50215).
Conclusion:
Unit testing is not supported by CF projects and instead the tests get retargeted to the full framework (much like Deploy to My Computer).
Link:
For an open source project that supports unit tests running on the device, see CFNUnitBridge from Trey
Labels: Mobile and Embedded
Copyright © Daniel Moth


