While trying to verify to myself, that C# Equals for IEnumerables is a reference equals, I found something odd. With the following setup in NUnit
var a = (IEnumerable<string>)(new[] { "one", "two" });
var b = (IEnumerable<string>)(new[] { "one", "two" });
this test
Assert.IsFalse(a.Equals(b));
passes, while this test
Assert.AreNotEqual(a, b);
doesn't. Can anybody explain why?
Edit: Thanks for the answers. I just read the documentation for NUnit, and it says the same thing, that AreEqual and AreNotEqual with collections test for equality of each element of the collection. I guess I was stuck with the notion, that AreEqual and AreNotEqual was just using plain Equals.