public void UnseqequalityComparerViaBuilder2() { SCG.IEqualityComparer <C5.HashSet <int> > h = C5.EqualityComparer <C5.HashSet <int> > .Default; C5.HashSet <int> s = new C5.HashSet <int>(); s.Add(1); s.Add(2); s.Add(3); Assert.AreEqual(CHC.unsequencedhashcode(1, 2, 3), h.GetHashCode(s)); }
public void SeqequalityComparerViaBuilder3() { SCG.IEqualityComparer <C5.IList <int> > h = C5.EqualityComparer <C5.IList <int> > .Default; C5.IList <int> s = new LinkedList <int>(); s.Add(1); s.Add(2); s.Add(3); Assert.AreEqual(CHC.sequencedhashcode(1, 2, 3), h.GetHashCode(s)); }
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); }