tags:

views:

35

answers:

3

In NUnit, I can write 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?

+1  A: 

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

JSBangs
A: 

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

Jason
A: 

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.

Grant Palin
That's good to know. Thanks!
Anna Lear