Ejemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hash = ProcessInstanceId.GetHashCode();
         // Suitable nullity checks etc, of course :)
         if (ProcessKey != null)
         {
             hash = hash * 17 + ProcessKey.GetHashCode();
         }
         if (ProcessInstanceName != null)
         {
             hash = hash * 17 + ProcessInstanceName.GetHashCode();
         }
         if (BusinessKey != null)
         {
             hash = hash * 17 + BusinessKey.GetHashCode();
         }
         hash = hash * 17 + SuspensionState.GetHashCode();
         if (UserCandidates != null)
         {
             hash = hash * 17 + UserCandidates.GetHashCode();
         }
         if (Owner != null)
         {
             hash = hash * 17 + Owner.GetHashCode();
         }
         return(hash);
     }
 }
        public void Should_not_be_equal_with_different_signing_keys()
        {
            var key1 = new BusinessKey("client-id", "signing-key1");
            var key2 = new BusinessKey("client-id", "signing-key2");

            Assert.NotEqual(key1, key2);
            Assert.NotEqual(key1.GetHashCode(), key2.GetHashCode());
        }
        public void Should_be_equal_by_value()
        {
            var key1 = new BusinessKey("client-id", "signing-key");
            var key2 = new BusinessKey("client-id", "signing-key");

            Assert.Equal(key1, key2);
            Assert.Equal(key1.GetHashCode(), key2.GetHashCode());
        }
Ejemplo n.º 4
0
        public override int GetHashCode()
        {
            int hashcode = 157;

            unchecked {
                if ((UniqueId != null) && __isset.uniqueId)
                {
                    hashcode = (hashcode * 397) + UniqueId.GetHashCode();
                }
                if ((BusinessKey != null) && __isset.businessKey)
                {
                    hashcode = (hashcode * 397) + BusinessKey.GetHashCode();
                }
                if ((Data != null) && __isset.data)
                {
                    hashcode = (hashcode * 397) + Data.GetHashCode();
                }
            }
            return(hashcode);
        }
 public override int GetHashCode()
 {
     return(BusinessKey.GetHashCode());
 }