适用于 Windows Phone 的 VS 2010 Express 中的单元测试

发布于 2024-12-09 05:20:48 字数 412 浏览 3 评论 0原文

我正在开发一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暮凉 2024-12-16 05:20:48

看一下这个问题: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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文