Visual Studio Orcas支持智能设备应用程序的单元测试
Visual Studio Orcas为智能设备开发带来一个十分有用的功能,就是可以对NetCF V2应用程序进行单元测试。
准备:
1.下载并安装Visual Studio Orcas CTP
2.确保智能设备或设备模拟器已经安装了NetCF V2
步骤:
1.创建一个NetCF v2项目,不要选择控制台应用程序,目前还存在缺陷
2.在任意方法上,点击右键并选择'Create Unit Tests'
3.在弹出对话框中选择'Create a new Smart Device Visual C# Test Project' (or the equivalent VB one),创建单元测试项目
4.你将看到一个测试项目,现在可以编写你的单元测试代码
5.选择菜单'Test->Windows->Test Manager',你会看到所有的单元测试的列表
6.选中'All Loaded Tests'
7.点击'Run Checked Tests'(绿色箭头的按钮)
8.你的测试将被运行,测试结果将显示在测试结果窗体
准备:
1.下载并安装Visual Studio Orcas CTP
2.确保智能设备或设备模拟器已经安装了NetCF V2
步骤:
1.创建一个NetCF v2项目,不要选择控制台应用程序,目前还存在缺陷
2.在任意方法上,点击右键并选择'Create Unit Tests'
3.在弹出对话框中选择'Create a new Smart Device Visual C# Test Project' (or the equivalent VB one),创建单元测试项目
4.你将看到一个测试项目,现在可以编写你的单元测试代码
5.选择菜单'Test->Windows->Test Manager',你会看到所有的单元测试的列表
6.选中'All Loaded Tests'
7.点击'Run Checked Tests'(绿色箭头的按钮)
8.你的测试将被运行,测试结果将显示在测试结果窗体
Smart Device Testing
![]()
另外,Oracas已经把Device Security Manager (Windows Mobile Powertoy)集成到开发环境中,可以方便的为智能设备定制安全策略。
Device Security Manager
New Smart Device Project
![]()
在Mobile Client Software Factory中也提供了为NetCF V2程序进行单元测试的解决方案,有兴趣的朋友可以看看。
参考:
Unit Testing for .Net Compact Framework
Orcas - another round of VS improvements
Some pictures of the Sept Orcas CTP
浙公网安备 33010602011771号