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.
精彩评论