适用于 Windows Phone 的 VS 2010 Express 中的单元测试
我正在开发一个 Windows Phone 7 项目,希望在独立的单元测试中测试应用程序的业务逻辑(即只是普通的 C# 代码),从命令行(来自 Jenkins)在 Windows 上运行,而不是在设备上运行。
仅使用免费 Express 工具实现此目的的最佳方法是什么?
目前我正在考虑:
- 像往常一样使用 VS Express WP 开发主 WP7 项目
- 让构建脚本复制 WP7 代码并生成包含每个源文件的 VC# 控制台项目文件
- 使用 Visual C# 2010 Express 在第二个项目中创建单元测试代码
- 编译 Windows 测试代码并使用 NUnit、Express Unit 或类似工具运行单元测试。
听起来很麻烦,有没有人有过比这更好的选择的经验?
I am developing a Windows Phone 7 project and wish to test the app's business logic (i.e. just the vanilla C# code) within stand-alone unit tests, run on Windows from the command line (from Jenkins) rather than on a device.
What's the best way of achieving this using the free Express tools only?
Currently I am thinking of:
- Developing the main WP7 project using VS Express WP as usual
- Having a build script copy the WP7 code and generate a VC# console project file containing each source file
- Create unit test code in this second project using Visual C# 2010 Express
- Compile test code for Windows and run unit tests using NUnit, Express Unit or similar.
Sounds like a whole lot of hassle, does anyone have experience of a nicer option than this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看一下这个问题:Windows Phone 单元测试的状态
它有一些不错的想法和提示,但恐怕目前也好不了多少。
Have a look at this question: State of unit testing for Windows Phone
It has some nice ideas and hints and I am afraid that it isn't much better at this time.