public void GetHashCode_Twice_IsEqual() { var test1 = new Instant(123L); var test2 = new Instant(123L); Assert.AreEqual(test1.GetHashCode(), test1.GetHashCode()); Assert.AreEqual(test2.GetHashCode(), test2.GetHashCode()); }
public void GetHashCode_DifferentTicks_IsDifferent() { var test1 = new Instant(123L); var test2 = new Instant(123L); var test3 = new Instant(321L); Assert.AreNotEqual(test1.GetHashCode(), test3.GetHashCode()); Assert.AreNotEqual(test2.GetHashCode(), test3.GetHashCode()); }
public override int GetHashCode() { unchecked { return((Instant.GetHashCode() * 397) ^ (ReturnFlight != null ? ReturnFlight.GetHashCode() : 0)); } }
public override int GetHashCode() { int hash = 1; if (typeCase_ == TypeOneofCase.Time) { hash ^= Time.GetHashCode(); } if (typeCase_ == TypeOneofCase.Charges) { hash ^= Charges.GetHashCode(); } if (typeCase_ == TypeOneofCase.Profession) { hash ^= Profession.GetHashCode(); } if (typeCase_ == TypeOneofCase.Permanent) { hash ^= Permanent.GetHashCode(); } if (typeCase_ == TypeOneofCase.Instant) { hash ^= Instant.GetHashCode(); } if (typeCase_ == TypeOneofCase.Challenge) { hash ^= Challenge.GetHashCode(); } hash ^= (int)typeCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public override int GetHashCode() { int hash = 1; if (duration_ != null) { hash ^= Duration.GetHashCode(); } if (instant_ != null) { hash ^= Instant.GetHashCode(); } if (localDate_ != null) { hash ^= LocalDate.GetHashCode(); } if (localTime_ != null) { hash ^= LocalTime.GetHashCode(); } if (IsoDayOfWeek != global::Google.Type.DayOfWeek.Unspecified) { hash ^= IsoDayOfWeek.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data /// structures like a hash table. /// </returns> public override int GetHashCode() { int hash = 23; hash = hash * 31 + Instant.GetHashCode(); hash = hash * 31 + NewOffset.GetHashCode(); return(hash); }
/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// </returns> public override int GetHashCode() { unchecked { int hashCode = Instant.GetHashCode(); hashCode = (hashCode * 397) ^ (_name != null ? _name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)_options; return(hashCode); } }