Classic Model

In the Classic model, a separate Assert method is used for each different assertion. This is how assertions were originally written in most test frameworks, which is why we we describe it as Classic.

Nowadays, we retain only a small set of Classic Asserts, as a convenient shorthand for some common Constraint-based Asserts.

Assert.IsTrue Tests that a boolean condition is true.
Assert.IsNull Tests that an object is null.
Assert.IsNotNull Tests that an object is not null.
Assert.IsEmpty Tests that a string or collection is empty.
Assert.IsNotEmpty Tests that a string or collection is not empty.
Assert.AreEqual Tests that the two arguments are equal.
Assert.AreNotEqual Tests that the two arguments are unequal.
Assert.AreSame Tests that the two arguments reference the same object.
Assert.AreNotSame Tests that the two arguments do not reference the same object.
Assert.Pass Causes a test to terminate immediately with a passing result.
Assert.Fail Causes a test to terminate immediately with a failing result.
Assert.Warn Causes a test to terminate immediately with an warning result.
Assert.Ignore Causes a test to terminate immediately with an ignored result.
Assert.Inconclusive Causes a test to terminate immediately with an warning result.