我不明白为什么这个测试会失败并显示消息“Assert.AreEqual failed. Expected:<2>.Actual:<1>。”
[TestMethod]
public void Test()
{
char[] a1 = "abc".ToCharArray();
char[] a2 = {'a', 'b', 'c', ' ', ' '};
Assert.AreEqual(2, a2.Except(a1).Count());
}
但以下将通过:
[TestMethod]
public void Test()
{
char[] a1 = "abc".ToCharArray();
char[] a2 = {'a', 'b', 'c', ' ', 'd', ' '};
Assert.AreEqual(2, a2.Except(a1).Count());
}