开发者

Choosing a test platform for .NET - MbUnit or the one by Microsoft?

开发者 https://www.devze.com 2022-12-16 05:57 出处:网络
I have chosen these two as primary开发者_如何转开发 candidates. My thinking goes like this: MbUnit has had a nice start and enjoys a smart, dedicated team of developers.

I have chosen these two as primary开发者_如何转开发 candidates. My thinking goes like this:

  • MbUnit has had a nice start and enjoys a smart, dedicated team of developers.
  • MSFT has many resources and can compete with MbUnit easily if they choose to do so.

Which one do you believe I should bet on?


I love MbUnit because it supports parametrized tests through attributes. So you can do something like this:

[Test]
[Row(2,1,2)]
[Row(4,3,1)]
[Row(ExpectedException(typeof(DivideByZeroException)))]
void TestIntDivision(int numerator, int denominator, int result)
{
  Assert.AreEqual(result, numerator/denominator);
}


NUnit is more widespread, MbUnit has the most features, but MSTest has more manpower behind it. Check this question out: NUnit vs. MbUnit vs. MSTest vs. xUnit.net


Microsoft unit testing framework is kind of tied to Visual Studio. This is both an advantage and disadvantage. Advantage is you can run tests easily from Visual Studio out of the box, disadvantage is forget about Mono support. It's worth noting that VS2010 will support 3rd party unit test frameworks.

0

精彩评论

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