Class1.cs:
namespace ClassLibrary1
{
public class Class1
{
Array arr1 = new[] { 1, 2, 3, 4, 5 };
public Array getArray()
{
return arr1;
}
}
}
ArrayEqualTest.cs:
[TestMethod()]
public void getArrayTest()
{
Class1 target = new Class1();
Array expected = new []{1,2,3,4,5};
Array actual;
actual = target.getArray();
CollectionAssert.AreEqual(expected, actual);
//Assert.IsTrue(expected.S actual, "is the test results");
}
Тест успешен, обнаружена ошибка:
CollectionAssert.AreEqual failed. (Element at index 3 do not match.)