Exemple #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Network.Length != 0)
            {
                hash ^= Network.GetHashCode();
            }
            hash ^= outputs_.GetHashCode();
            if (Time != 0UL)
            {
                hash ^= Time.GetHashCode();
            }
            if (Expires != 0UL)
            {
                hash ^= Expires.GetHashCode();
            }
            if (Memo.Length != 0)
            {
                hash ^= Memo.GetHashCode();
            }
            if (PaymentUrl.Length != 0)
            {
                hash ^= PaymentUrl.GetHashCode();
            }
            if (MerchantData.Length != 0)
            {
                hash ^= MerchantData.GetHashCode();
            }
            return(hash);
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Address != null)
         {
             hashCode = hashCode * 59 + Address.GetHashCode();
         }
         if (Memo != null)
         {
             hashCode = hashCode * 59 + Memo.GetHashCode();
         }
         if (Nickname != null)
         {
             hashCode = hashCode * 59 + Nickname.GetHashCode();
         }
         if (WalletType != null)
         {
             hashCode = hashCode * 59 + WalletType.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemple #3
0
// ReSharper disable InconsistentNaming
        public void MemoGetHashCode_UnitTest_Result_HashCodeOfID()
// ReSharper restore InconsistentNaming
        {
            var memo = new Memo {
                InstanceID = Guid.NewGuid()
            };
            var expected = memo.InstanceID.GetHashCode();
            var actual   = memo.GetHashCode();

            Assert.AreEqual(expected, actual);
        }
Exemple #4
0
        public void MemoGetHashCode_UnitTest_Result_HashCodeOfID()

        {
            var memo = new Memo {
                InstanceID = Guid.NewGuid()
            };
            var expected = memo.InstanceID.GetHashCode();
            var actual   = memo.GetHashCode();

            Assert.AreEqual(expected, actual);
        }
Exemple #5
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hash = 17;
         hash = hash * 23 + Date.GetHashCode();
         hash = hash * 23 + Payee.GetHashCode();
         hash = hash * 23 + Memo.GetHashCode();
         hash = hash * 23 + Inflow.GetHashCode();
         hash = hash * 23 + OutFlow.GetHashCode();
         return(hash);
     }
 }
Exemple #6
0
 public void Start()
 {
     Memo         = Clone();
     MemoHashCode = Memo.GetHashCode();
 }