开发者

New to TDD for .NET, NUnit or MSTest

开发者 https://www.devze.com 2022-12-15 12:26 出处:网络
I understand that the \"NUnit vs. MSTest\" question has been asked alot on SO. However, I have a simple question that I think hasn\'t been answered directly.

I understand that the "NUnit vs. MSTest" question has been asked alot on SO. However, I have a simple question that I think hasn't been answered directly.

I am new to TDD, and I know that both have their pro's and con's, however I 开发者_JAVA技巧want to know from a simplicity point of view which would be easier, MSTest or NUnit?

I have no preconceived favorites, I just want to know if there are things that one has that the other does not that are large differences.


From the simplicity perspective MSTest has a clear bonus in terms of IDE Integration. No download, no install, no configuration just start unit testing. It's perfect to get your feet wet. I'd switch to NUnit (or personally MbUnit) later on.

For the basics (which you will definately start with) both frameworks have equal capabilities. When switching to any other framework you will notice some things are named differently, however the concepts remain the same. It's like switching from Java to C#.


There's a nice comparison of unit testing frameworks. My personal advice would be to go with MSTest only if you use Microsoft Team Foundation Server for continuous integration, otherwise stick with open source alternatives.


I've actually never used MSTest myself since I started learning TDD with nUnit right away. One of the reasons I did not try out MSTest first was that I heard mostly negative opinions whenever I mentioned it to most TDD'ers. Again, I have no personal experience with it, I can only say I find nUnit easy to use.

There are also quite a few other options out there like xUnit and MBUnit which people also enjoy using and I have heard many good things about them. For my part I can say nUnit is a very full featured test framework and it works well for me.

If IDE integration is important, then I would suggest you get ReSharper which provides excellent IDE integration for nUnit and it also has support for most popular test frameworks, either natively or via plugins. Besides, everyone should be using ReSharper anyways, right? ;-).

0

精彩评论

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