开发者

Unit testing framework for .NET, Comparison? [closed]

开发者 https://www.devze.com 2022-12-22 06:48 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. 开发者_运维百科 Closed 9 years ago.

I have used a bit of MS VS2008 integrated Unit Testing framework for writing unit test, but not that extensive, any suggestions which framework will work best for web based applications developed using ASP.NET.


I use the VS integrated framework with an MVP pattern. The web tests of vs works fine for me.


Pretty much any framework will work for you so long as you have some separation of concerns such that your asp.net code is testable. There is a comparison matrix here:

http://xunit.codeplex.com/wikipage?title=Comparisons&referringTitle=Home

probably a bit xunit biased. I actually really like xunit after having used it on the subsonic project. You can get tight visual studio integration using testdriven.net

If you're looking to do functional testing then look at End-to-End application testing from a users standpoint


For web tests I use Selenium, and then for testing the "backend" I will use nUnit/MbUnit. Selenium allows you to either record scripts via a browser plugin or create the tests as a set of methods much the same as standard nUnit unit tests with some specific syntax for driving selenium.

Selenium - Tutorials and downloads


I've played with Telerik's new WebUITest studio and it does look pretty slick for UI testing. However, it is very expensive and Selenium is pretty attractive for free. If you are in a large organization with a distinct QA group doing testing then I'd check out Telerik. Otherwise, Selenium.

BTW: I have to second stimmms' point about having a proper separation of concerns for your application unit testing - it makes all the difference.


MS's unit testing framework is not far from being a direct copy of NUnit 2.2 - semantic differences only. NUnit has probably had more support since then, so I'd give it a small edge. But only a small one.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号