Example #1
0
 /// <summary>
 /// Returns a hash code for the current object.
 /// </summary>
 /// <returns>A hash code for the current object.</returns>
 public override int GetHashCode()
 {
     // combine the hash codes of the various components of this class
     return(HashCodeUtility.CombineHashCodes(ObjectUtility.GetHashCode(m_text), m_count));
 }
Example #2
0
 public void GetHashCodeValue()
 {
     Assert.AreEqual(3.GetHashCode(), ObjectUtility.GetHashCode(3));
 }
Example #3
0
 public void GetHashCodeNull()
 {
     ObjectUtility.GetHashCode(default(string));
 }
Example #4
0
        public void GetHashCodeNotNull()
        {
            const string str = "happy";

            Assert.AreEqual(str.GetHashCode(), ObjectUtility.GetHashCode(str));
        }
Example #5
0
 public void GetHashCode(object obj, int hashCode)
 {
     Assert.That(ObjectUtility.GetHashCode(obj), Is.EqualTo(hashCode));
 }