How does Assert.AreEqual determine equality between two generic IEnumerables?
问题 I have a unit test to check whether a method returns the correct IEnumerable . The method builds the enumerable using yield return . The class that it is an enumerable of is below: enum TokenType { NUMBER, COMMAND, ARITHMETIC, } internal class Token { public TokenType type { get; set; } public string text { get; set; } public static bool operator == (Token lh, Token rh) { return (lh.type == rh.type) && (lh.text == rh.text); } public static bool operator != (Token lh, Token rh) { return !(lh =