GetHashCode() public method

public GetHashCode ( List, a ) : int
a List,
return int
        public void EmptyLists()
        {
            var comparer = new ListComparer <DateTime>();
            var list1    = new List <DateTime>();
            var list2    = new List <DateTime>();

            Assert.IsTrue(comparer.Equals(list1, list2));
            Assert.AreEqual(comparer.GetHashCode(list2), comparer.GetHashCode(list1));
        }
        public void DateTimeDifferent()
        {
            var comparer = new ListComparer <DateTime>();
            var list1    = new List <DateTime> {
                new DateTime(2019)
            };
            var list2 = new List <DateTime> {
                new DateTime(2017)
            };

            Assert.IsFalse(comparer.Equals(list1, list2));
            Assert.AreNotEqual(comparer.GetHashCode(list2), comparer.GetHashCode(list1));
        }
        public override int GetHashCode()
        {
            HashCodeBuilder hashBuilder = new HashCodeBuilder();

            hashBuilder.Append(dataSourceIdentifier)
            .Append(controlId)
            .Append(rangeComparer.GetHashCode(rangeDataList));
            return(hashBuilder.HashCode);
        }