public static void Equalities(string msg, SCG.IEqualityComparer <IList <int> > equalityComparer) { Console.WriteLine("\n{0}:", msg); Console.Write("Equals(col1,col2)={0,-5}; ", equalityComparer.Equals(_col1, _col2)); Console.Write("Equals(col1,col3)={0,-5}; ", equalityComparer.Equals(_col1, _col3)); Console.WriteLine("Equals(col2,col3)={0,-5}", equalityComparer.Equals(_col2, _col3)); }
public void UnseqequalityComparerViaBuilder() { SCG.IEqualityComparer <C5.ICollection <int> > h = C5.EqualityComparer <C5.ICollection <int> > .Default; C5.ICollection <int> s = new LinkedList <int>(); C5.ICollection <int> t = new LinkedList <int>(); C5.ICollection <int> u = new LinkedList <int>(); s.Add(1); s.Add(2); s.Add(3); t.Add(3); t.Add(2); t.Add(1); u.Add(3); u.Add(2); u.Add(4); Assert.AreEqual(s.GetUnsequencedHashCode(), h.GetHashCode(s)); Assert.IsTrue(h.Equals(s, t)); Assert.IsFalse(h.Equals(s, u)); Assert.AreSame(h, C5.EqualityComparer <C5.ICollection <int> > .Default); }