开发者

Is there a functional difference between Assert.That and traditional syntax?

In NUnit, I can wr开发者_Go百科ite either

Assert.That(5, Is.EqualTo(5));

or

Assert.AreEqual(5, 5);

Is there any functional difference between these two forms or is the choice between the two just down to personal preference and perception of readability?


There isn't any semantic difference between the examples that you give. It solely comes down to preference.


The only difference is readability, and your preference on that matter. It is worth noting that the older syntax has been reimplemented to work off of the new behind the scenes, so that are functionally the same.


No, there is no functional difference. This is just the fluent API versus the classical syntax. It does come down to personal preference.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜