I am at a loss to understand why this Test would fail with Message “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());
}
but the following would pass:
[TestMethod]
public void Test()
{
char[] a1 = "abc".ToCharArray();
char[] a2 = {'a', 'b', 'c', ' ', 'd', ' '};
Assert.AreEqual(2, a2.Except(a1).Count());
}
because except finds difference of two sequences
http://msdn.microsoft.com/ru-ru/library/system.linq.enumerable.except.aspx
maybe you need something like this