Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

syntax

nunit

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?

like image 792
Adam Lear Avatar asked Mar 09 '10 20:03

Adam Lear


2 Answers

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

like image 104
JSBձոգչ Avatar answered Sep 28 '22 16:09

JSBձոգչ


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.

like image 43
Grant Palin Avatar answered Sep 28 '22 14:09

Grant Palin