NUnit与Visual Studio 2008的单元测试测试项目 [英] NUnit vs. Visual Studio 2008's test projects for unit testing

查看:106
本文介绍了NUnit与Visual Studio 2008的单元测试测试项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将要在工作中启动一个新项目,并想进入单元测试.我们将使用Visual Studio 2008,C#和ASP.NET MVC东西.我正在考虑使用NUnit或Visual Studio 2008具有的内置测试项目,但是我愿意研究其他建议.一个系统是否比另一个系统更好,或者可能比另一个系统更易于使用/理解?

I am going to be starting up a new project at work and want to get into unit testing. We will be using Visual Studio 2008, C#, and the ASP.NET MVC stuff. I am looking at using either NUnit or the built-in test projects that Visual Studio 2008 has, but I am open to researching other suggestions. Is one system better than the other or perhaps easier to use/understand than the other?

我希望将此项目设置为最佳做法"为我们未来的发展努力.

I am looking to get this project set up as kind of the "best practice" for our development efforts going forward.

推荐答案

Daok named all the pro's of Visual Studio 2008 test projects. Here are the pro's of NUnit.

  • NUnit有一个模拟框架.
  • NUnit可以在 IDE.如果您愿意,这可能会很有用 在非Microsoft构建服务器上运行测试, 像 CruiseControl.NET .
  • NUnit推出了更多版本 比视觉工作室.你没有 等待几年才能获得新版本. 而且您不必安装新版本的IDE即可 获得新功能.
  • 正在开发扩展程序 用于NUnit,例如行测试等.
  • Visual Studio测试需要很长时间 由于某种原因启动.这是 在Visual Studio 2008中更好 但是还是太慢了 为了我的口味快速运行测试 看看你是否没有破坏任何东西 可能需要太长时间. NUnit与 像Testdriven.Net这样的东西可以运行 从IDE进行的测试实际上很多 快点.特别是跑步时 单项测试. 根据Kjetil Klaussen的说法,这是由Visual Studio测试运行程序引起的.在TestDriven.Net中运行MSTest测试可以使MSTest性能与NUnit相当.
  • NUnit has a mocking framework.
  • NUnit can be run outside of the IDE. This can be useful if you want to run tests on a non-Microsoft build server, like CruiseControl.NET.
  • NUnit has more versions coming out than visual studio. You don't have to wait years for a new version. And you don't have to install a new version of the IDE to get new features.
  • There are extensions being developed for NUnit, like row-tests, etc.
  • Visual Studio tests take a long time to start up for some reason. This is better in Visual Studio 2008, but it is still too slow for my taste. Quickly running a test to see if you didn't break something can take too long. NUnit with something like Testdriven.Net to run tests from the IDE is actually much faster. Especially when running single tests. According to Kjetil Klaussen, this is caused by the Visual Studio testrunner. Running MSTest tests in TestDriven.Net makes MSTest performance comparable to NUnit.

这篇关于NUnit与Visual Studio 2008的单元测试测试项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆