Here I used the nice-to-read syntax Assert.That()introduced in NUnit 2.4 . The important point is that the restriction Is.EqualTowill ensure the order of the parameters.
[TestFixture]
public class UnitTest
{
[Test]
public void SameOrder()
{
IEnumerable<int> expected = new[] { 1, 9, 0, 4};
IEnumerable<int> actual = new[] { 1, 9, 0, 4 };
Assert.That(actual, Is.EqualTo(expected));
}
[Test]
public void WrongOrder()
{
IEnumerable<int> expected = new[] { 1, 9, 0, 4 };
IEnumerable<int> actual = new[] { 9, 0, 1, 4 };
Assert.That(actual, Is.EqualTo(expected));
}
}
source
share