Differences Working With Testing Tools for Smart Devices
If you are familiar with the desktop testing tools, you should know about the following differences when you work with smart device testing tools. The differences are organized in the following categories:
Smart Device Unit Tests
Smart device unit tests use the device Unit Testing Framework (UTF) which targets versions 2.0 and 3.5 of the .NET Compact Framework instead of the UTF that targets the .NET Framework.
For more information, see Unit Testing Framework (Devices).
Smart device unit tests cannot have user-defined attributes that do not run on the desktop.
Smart device unit tests must run under the Smart Device host and cannot run under the Default or ASP.NET host.
For more information, see How to: Specify a Test Run Configuration.
Selecting Start Debugging in the Debug menu, DebugSelection in the TestView window, or DebugCheckedtests in the TestListEditor only runs and does not debug a test that runs under the smart device host.
For more information, see How to: Debug while Running a Smart Device Unit Test.
When you deploy tests, Visual Studio does not automatically deploy and install the .NET Compact Framework or SQL Server Compact to the target device or emulator. Your emulator or device must have them installed before running a test. For more information, see How to: Install the .NET Compact Framework on a Device and How to: Install SQL Server Compact 3.5 on a Device.
Visual Studio runs tests on the device selected in the active test run configuration and not on the device selected in the Device toolbar. For more information, see How to: Specify a Test Run Configuration.
Smart Device Test Projects
- For information about differences, see Smart Device Test Projects.
Unsupported User Interface Controls
Smart device testing tools do not support one-click debugging, performance session, or code coverage. For information about manually attaching to a debugger, see How to: Debug while Running a Smart Device Unit Test. The following testing controls and menu options have not been disabled and do not behave as expected:
Test tools toolbar
Debug tests
Debug All tests
Code Coverage Results
Show Code Coverage Coloring
Test List Editor
Debug Checked Tests
Test menu
Debug Tests
Debug All Tests
Test View
Debug Selection (on the Toolbar, shortcut menu)
Create Performance Session (shortcut menu)
Test Results
Debug (Toolbar)
Show Code Coverage Results (Toolbar)
Debug Original Tests (hyperlink in the status bar)
Create Performance Session (shortcut menu)
Code Coverage Results (shortcut menu)
Command-Line Execution
The /runconfig argument is required when you run smart device tests at a command prompt. For more information, see MSTest.exe Command-Line Options.
Test Deployment
You must set CopyLocal=true in the Properties window for assemblies that are referenced but are not part of the project or solution. This ensures that the assembly is copied to the device when the test runs. Alternatively, you can manually copy the assembly to the device before you run the test.
Enable Deployment must be checked. If you have a smart device test in your test run, make sure that the check box is checked.