Exemplo n.º 1
0
        public void ObjectEquals()
        {
            SequenceNumber num  = new SequenceNumber(58);
            SequenceNumber num2 = new SequenceNumber(58);
            SequenceNumber num3 = new SequenceNumber(59);

            object oNum = num;

            Assert.That(num.Equals(num2));
            Assert.That(num.Equals(num));
            Assert.That(oNum.Equals(oNum));
            Assert.That(num.Equals(null), Is.False);
            Assert.That(num.Equals(num3), Is.False);
            Assert.That(num.Equals(new object()), Is.False);
        }
Exemplo n.º 2
0
 /// <summary>
 /// True iff the two objects are equal Layers.
 /// </summary>
 public bool Equals(GreLayer other)
 {
     return(other != null &&
            Version.Equals(other.Version) &&
            ProtocolType.Equals(other.ProtocolType) &&
            RecursionControl.Equals(other.RecursionControl) &&
            FutureUseBits.Equals(other.FutureUseBits) &&
            ChecksumPresent.Equals(other.ChecksumPresent) &&
            (Checksum == null ? other.Checksum == null : Checksum.Equals(other.Checksum)) &&
            (Key == null ? other.Key == null : Key.Equals(other.Key)) &&
            (SequenceNumber == null ? other.SequenceNumber == null : SequenceNumber.Equals(other.SequenceNumber)) &&
            (AcknowledgmentSequenceNumber == null ? other.AcknowledgmentSequenceNumber == null : AcknowledgmentSequenceNumber.Equals(other.AcknowledgmentSequenceNumber)) &&
            (RoutingOffset == null ? other.RoutingOffset == null : RoutingOffset.Equals(other.RoutingOffset)) &&
            (Routing == null ? other.Routing == null : Routing.SequenceEqual(other.Routing)) &&
            StrictSourceRoute.Equals(other.StrictSourceRoute));
 }
Exemplo n.º 3
0
        public bool Equals(DestinyVendorReceipt input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     CurrencyPaid == input.CurrencyPaid ||
                     (CurrencyPaid != null && CurrencyPaid.SequenceEqual(input.CurrencyPaid))
                     ) &&
                 (
                     ItemReceived == input.ItemReceived ||
                     (ItemReceived != null && ItemReceived.Equals(input.ItemReceived))
                 ) &&
                 (
                     LicenseUnlockHash == input.LicenseUnlockHash ||
                     (LicenseUnlockHash.Equals(input.LicenseUnlockHash))
                 ) &&
                 (
                     PurchasedByCharacterId == input.PurchasedByCharacterId ||
                     (PurchasedByCharacterId.Equals(input.PurchasedByCharacterId))
                 ) &&
                 (
                     RefundPolicy == input.RefundPolicy ||
                     (RefundPolicy != null && RefundPolicy.Equals(input.RefundPolicy))
                 ) &&
                 (
                     SequenceNumber == input.SequenceNumber ||
                     (SequenceNumber.Equals(input.SequenceNumber))
                 ) &&
                 (
                     TimeToExpiration == input.TimeToExpiration ||
                     (TimeToExpiration.Equals(input.TimeToExpiration))
                 ) &&
                 (
                     ExpiresOn == input.ExpiresOn ||
                     (ExpiresOn != null && ExpiresOn.Equals(input.ExpiresOn))
                 ));
        }