Differences between Assert.True and Assert.IsTrue in NUnit?

Vlad Titov picture Vlad Titov · Sep 10, 2012 · Viewed 11.9k times · Source

Is there any differences between those two?

Answer

sll picture sll · Sep 10, 2012

No difference. Assert.True() and others (without Is) were added since v2.5.

From documentation for the version 2.5: (nunit v2.5)

Two forms are provided for the True, False, Null and NotNull conditions. The "Is" forms are compatible with earlier versions of the NUnit framework, while those without "Is" are provided for compatibility with NUnitLite

BTW, Disassembled nunit.framework.dll (using ILSPY)

public static void IsTrue(bool condition)
{
    Assert.That(condition, Is.True, null, null);
}

public static void True(bool condition)
{
    Assert.That(condition, Is.True, null, null);
}