Is NUnit 3 removing the 'classic' syntax for tests?

772 views Asked by At

Nunit currently has two styles of writing test.

Classic style

Assert.AreEqual(x, y);

New Style

Assert.That(y, Is.EqualTo(x);

The Release notes for NUnit 2.9.3 (Scroll down!) says

Support for old style tests has been removed

Do they mean the Classic style is removed?

1

There are 1 answers

0
samy On BEST ANSWER

It is not removed in v3. Looking at the latest alpha 2 we can see that the methods Are* still exist in the Assert object eg

public static void AreEqual(int expected, int actual)
{
    Assert.That<int>(actual, Is.EqualTo(expected), null, null);
}

Old style tests is the prefixing of tests with "Test" (see also this launchpad)