Пример #1
0
        public void Equals_SameType_NotSameObjects_SameAsGuid(byte[] correctBytes)
        {
            Assert.Multiple(() =>
            {
                Assert.AreEqual(16, correctBytes.Length);

                var uuidBytes1 = new byte[16];
                var uuidBytes2 = new byte[16];
                var uuidBytes3 = new byte[16];
                Array.Copy(correctBytes, uuidBytes1, 16);
                Array.Copy(correctBytes, uuidBytes2, 16);
                Array.Copy(correctBytes, uuidBytes3, 16);

                unchecked
                {
                    uuidBytes2[0]++;
                    uuidBytes3[8]++;
                }

                var uuid1 = new Uuid(uuidBytes1);
                var uuid2 = new Uuid(uuidBytes2);
                var uuid3 = new Uuid(uuidBytes3);

                var guid1 = new Guid(uuidBytes1);
                var guid2 = new Guid(uuidBytes2);
                var guid3 = new Guid(uuidBytes3);

                Assert.IsFalse(guid1.Equals(guid2));
                Assert.IsFalse(guid1.Equals(guid3));
                Assert.IsFalse(uuid1.Equals(uuid2));
                Assert.IsFalse(uuid1.Equals(uuid3));
            });
        }
Пример #2
0
        /// <summary>
        /// Returns true if UserPasswordChangeSubmit instances are equal
        /// </summary>
        /// <param name="other">Instance of UserPasswordChangeSubmit to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(UserPasswordChangeSubmit other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     NewPassword == other.NewPassword ||
                     NewPassword != null &&
                     NewPassword.Equals(other.NewPassword)
                 ) &&
                 (
                     NewPasswordConfirmed == other.NewPasswordConfirmed ||
                     NewPasswordConfirmed != null &&
                     NewPasswordConfirmed.Equals(other.NewPasswordConfirmed)
                 ) &&
                 (
                     OldPassword == other.OldPassword ||
                     OldPassword != null &&
                     OldPassword.Equals(other.OldPassword)
                 ));
        }
Пример #3
0
        /// <summary>
        /// Returns true if User instances are equal
        /// </summary>
        /// <param name="other">Instance of User to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(User other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     _User == other._User ||
                     _User != null &&
                     _User.Equals(other._User)
                 ) &&
                 (
                     Password == other.Password ||
                     Password != null &&
                     Password.Equals(other.Password)
                 ) &&
                 (
                     PasswordConfirmation == other.PasswordConfirmation ||
                     PasswordConfirmation != null &&
                     PasswordConfirmation.Equals(other.PasswordConfirmation)
                 ));
        }
Пример #4
0
        /// <summary>
        /// Returns true if Practitioner instances are equal
        /// </summary>
        /// <param name="other">Instance of Practitioner to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Practitioner other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     Active == other.Active ||
                     Active != null &&
                     Active.Equals(other.Active)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Photo == other.Photo ||
                     Photo != null &&
                     Photo.SequenceEqual(other.Photo)
                 ));
        }
Пример #5
0
        public void ShouldEqualSimilarUuidObject()
        {
            var uuid = new Uuid(1, 2);
            object other = new Uuid(1, 2);

            Assert.IsTrue(uuid.Equals(other));
        }
Пример #6
0
        public void ShouldNotEqualOtherUuidObject()
        {
            var uuid = new Uuid(1, 2);
            object other = new Uuid(3, 4);

            Assert.IsFalse(uuid.Equals(other));
        }
Пример #7
0
        public void ShouldNotEqualOtherUuidObject()
        {
            var    uuid  = new Uuid(1, 2);
            object other = new Uuid(3, 4);

            Assert.False(uuid.Equals(other));
        }
Пример #8
0
        public void ShouldEqualSimilarUuidObject()
        {
            var    uuid  = new Uuid(1, 2);
            object other = new Uuid(1, 2);

            Assert.True(uuid.Equals(other));
        }
Пример #9
0
        public bool IsEmptyData()
        {
            bool isEmpty = false;

            if (Name.Equals(DEFAULT_NAME))
            {
                if (Uuid.Equals(DEFAULT_UUID))
                {
                    if (Rssi == DEFAULT_RSSI)
                    {
                        if (Status.Equals(DEFAULT_STATUS))
                        {
                            if (LocalName.Equals(DEFAULT_LOCAL_NAME))
                            {
                                if (Connectable.Equals(DEFAULT_CONNECTABLE))
                                {
                                    isEmpty = true;
                                }
                            }
                        }
                    }
                }
            }
            return(isEmpty);
        }
        /// <summary>
        /// Returns true if CodeableConcept instances are equal
        /// </summary>
        /// <param name="other">Instance of CodeableConcept to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CodeableConcept other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     Code == other.Code ||
                     Code != null &&
                     Code.Equals(other.Code)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ));
        }
Пример #11
0
        /// <summary>
        /// Returns true if Permission instances are equal
        /// </summary>
        /// <param name="other">Instance of Permission to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Permission other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ));
        }
        /// <summary>
        /// Returns true if LdapAuthenticationModeSubmit instances are equal
        /// </summary>
        /// <param name="other">Instance of LdapAuthenticationModeSubmit to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(LdapAuthenticationModeSubmit other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     HostName == other.HostName ||
                     HostName != null &&
                     HostName.Equals(other.HostName)
                 ) &&
                 (
                     Port == other.Port ||

                     Port.Equals(other.Port)
                 ) &&
                 (
                     IsLdaps == other.IsLdaps ||

                     IsLdaps.Equals(other.IsLdaps)
                 ) &&
                 (
                     Account == other.Account ||
                     Account != null &&
                     Account.Equals(other.Account)
                 ) &&
                 (
                     Password == other.Password ||
                     Password != null &&
                     Password.Equals(other.Password)
                 ) &&
                 (
                     BaseDn == other.BaseDn ||
                     BaseDn != null &&
                     BaseDn.Equals(other.BaseDn)
                 ) &&
                 (
                     LdapAttributes == other.LdapAttributes ||
                     LdapAttributes != null &&
                     other.LdapAttributes != null &&
                     LdapAttributes.SequenceEqual(other.LdapAttributes)
                 ));
        }
Пример #13
0
        public void EqualsWithObjectNullReturnFalse(byte[] correctBytes)
        {
            var uuid = new Uuid(correctBytes);

            bool isEquals = uuid.Equals(null);

            Assert.False(isEquals);
        }
Пример #14
0
 public bool Equals([AllowNull] Booking other)
 {
     return(other != null &&
            Id == other.Id &&
            Uuid.Equals(other.Uuid) &&
            VehicleId == other.VehicleId &&
            VehicleUuid.Equals(other.VehicleUuid));
 }
Пример #15
0
        /// <summary>
        /// Returns true if Name instances are equal
        /// </summary>
        /// <param name="other">Instance of Name to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Name other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     Alias == other.Alias ||
                     Alias != null &&
                     Alias.Equals(other.Alias)
                 ) &&
                 (
                     First == other.First ||
                     First != null &&
                     First.Equals(other.First)
                 ) &&
                 (
                     Family == other.Family ||
                     Family != null &&
                     Family.Equals(other.Family)
                 ) &&
                 (
                     Given == other.Given ||
                     Given != null &&
                     Given.SequenceEqual(other.Given)
                 ) &&
                 (
                     Prefix == other.Prefix ||
                     Prefix != null &&
                     Prefix.SequenceEqual(other.Prefix)
                 ) &&
                 (
                     Suffix == other.Suffix ||
                     Suffix != null &&
                     Suffix.SequenceEqual(other.Suffix)
                 ) &&
                 (
                     Creation == other.Creation ||
                     Creation != null &&
                     Creation.Equals(other.Creation)
                 ) &&
                 (
                     LastUpdated == other.LastUpdated ||
                     LastUpdated != null &&
                     LastUpdated.Equals(other.LastUpdated)
                 ));
        }
Пример #16
0
        public void EqualsWithObjectOtherTypeReturnFalse(byte[] correctBytes)
        {
            var uuid = new Uuid(correctBytes);
            var objectWithAnotherType = (object)42;

            bool isEquals = uuid.Equals(objectWithAnotherType);

            Assert.False(isEquals);
        }
Пример #17
0
        /// <summary>
        /// Returns true if Team instances are equal
        /// </summary>
        /// <param name="other">Instance of Team to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Team other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     TeamIds == other.TeamIds ||
                     TeamIds != null &&
                     other.TeamIds != null &&
                     TeamIds.SequenceEqual(other.TeamIds)
                 ) &&
                 (
                     UserIds == other.UserIds ||
                     UserIds != null &&
                     other.UserIds != null &&
                     UserIds.SequenceEqual(other.UserIds)
                 ) &&
                 (
                     DataPolicyIds == other.DataPolicyIds ||
                     DataPolicyIds != null &&
                     other.DataPolicyIds != null &&
                     DataPolicyIds.SequenceEqual(other.DataPolicyIds)
                 ) &&
                 (
                     TermsOfServiceId == other.TermsOfServiceId ||
                     TermsOfServiceId != null &&
                     TermsOfServiceId.Equals(other.TermsOfServiceId)
                 ) &&
                 (
                     SubRealmId == other.SubRealmId ||
                     SubRealmId != null &&
                     SubRealmId.Equals(other.SubRealmId)
                 ));
        }
 public bool Equals([AllowNull] FuelPurchase other)
 {
     return(other != null &&
            Id == other.Id &&
            Uuid.Equals(other.Uuid) &&
            BookingId == other.BookingId &&
            BookingUuid.Equals(other.BookingUuid) &&
            VehicleId == other.VehicleId &&
            VehicleUuid.Equals(other.VehicleUuid));
 }
        /// <summary>
        /// Returns true if ContactPoint instances are equal
        /// </summary>
        /// <param name="other">Instance of ContactPoint to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ContactPoint other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     System == other.System ||
                     System != null &&
                     System.Equals(other.System)
                 ) &&
                 (
                     Value == other.Value ||
                     Value != null &&
                     Value.Equals(other.Value)
                 ) &&
                 (
                     Use == other.Use ||
                     Use != null &&
                     Use.Equals(other.Use)
                 ) &&
                 (
                     Rank == other.Rank ||
                     Rank != null &&
                     Rank.Equals(other.Rank)
                 ) &&
                 (
                     Period == other.Period ||
                     Period != null &&
                     Period.Equals(other.Period)
                 ) &&
                 (
                     Creation == other.Creation ||
                     Creation != null &&
                     Creation.Equals(other.Creation)
                 ) &&
                 (
                     LastUpdated == other.LastUpdated ||
                     LastUpdated != null &&
                     LastUpdated.Equals(other.LastUpdated)
                 ));
        }
Пример #20
0
 public bool Equals(BeaconData other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Uuid.Equals(other.Uuid) && Major == other.Major && Minor == other.Minor);
 }
Пример #21
0
        /// <summary>
        /// Returns true if Cost instances are equal
        /// </summary>
        /// <param name="other">Instance of Cost to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Cost other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     HourPrice == other.HourPrice ||
                     HourPrice != null &&
                     HourPrice.Equals(other.HourPrice)
                 ) &&
                 (
                     UsePrice == other.UsePrice ||
                     UsePrice != null &&
                     UsePrice.Equals(other.UsePrice)
                 ) &&
                 (
                     Unit == other.Unit ||
                     Unit != null &&
                     Unit.Equals(other.Unit)
                 ) &&
                 (
                     Period == other.Period ||
                     Period != null &&
                     Period.Equals(other.Period)
                 ) &&
                 (
                     Creation == other.Creation ||
                     Creation != null &&
                     Creation.Equals(other.Creation)
                 ) &&
                 (
                     LastUpdated == other.LastUpdated ||
                     LastUpdated != null &&
                     LastUpdated.Equals(other.LastUpdated)
                 ));
        }
Пример #22
0
        public void EqualsWithOtherUuid(
            byte[] correctBytes,
            byte[] correctEqualsBytes,
            bool expectedResult)
        {
            var uuid      = new Uuid(correctBytes);
            var otherUuid = new Uuid(correctEqualsBytes);

            bool isEquals = uuid.Equals(otherUuid);

            Assert.AreEqual(expectedResult, isEquals);
        }
Пример #23
0
        public void Equals_Object_AnotherType_SameAsGuid(byte[] correctBytes)
        {
            Assert.Multiple(() =>
            {
                Assert.AreEqual(16, correctBytes.Length);

                var uuid = new Uuid(correctBytes);
                var guid = new Guid(correctBytes);

                Assert.False(guid.Equals(42));
                Assert.False(uuid.Equals(42));
            });
        }
Пример #24
0
        public void Equals_Object_Null_SameAsGuid(byte[] correctBytes)
        {
            Assert.Multiple(() =>
            {
                Assert.AreEqual(16, correctBytes.Length);

                var uuid = new Uuid(correctBytes);
                var guid = new Guid(correctBytes);

                Assert.IsFalse(guid.Equals(null));
                Assert.IsFalse(uuid.Equals(null));
            });
        }
Пример #25
0
        /// <summary>
        /// Returns true if TermsOfService instances are equal
        /// </summary>
        /// <param name="other">Instance of TermsOfService to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(TermsOfService other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     AgreementName == other.AgreementName ||
                     AgreementName != null &&
                     AgreementName.Equals(other.AgreementName)
                 ) &&
                 (
                     Version == other.Version ||
                     Version != null &&
                     Version.Equals(other.Version)
                 ) &&
                 (
                     AgreementFileData == other.AgreementFileData ||
                     AgreementFileData != null &&
                     AgreementFileData.Equals(other.AgreementFileData)
                 ) &&
                 (
                     TeamIds == other.TeamIds ||
                     TeamIds != null &&
                     other.TeamIds != null &&
                     TeamIds.SequenceEqual(other.TeamIds)
                 ) &&
                 (
                     AcceptedUserIds == other.AcceptedUserIds ||
                     AcceptedUserIds != null &&
                     other.AcceptedUserIds != null &&
                     AcceptedUserIds.SequenceEqual(other.AcceptedUserIds)
                 ) &&
                 (
                     SubRealmId == other.SubRealmId ||
                     SubRealmId != null &&
                     SubRealmId.Equals(other.SubRealmId)
                 ));
        }
Пример #26
0
        /// <summary>
        /// Assign properties to the current entry based on a template entry.
        /// </summary>
        /// <param name="peTemplate">Template entry. Must not be <c>null</c>.</param>
        /// <param name="bOnlyIfNewer">Only set the properties of the template entry
        /// if it is newer than the current one.</param>
        /// <param name="bIncludeHistory">If <c>true</c>, the history will be
        /// copied, too.</param>
        /// <param name="bAssignLocationChanged">If <c>true</c>, the
        /// <c>LocationChanged</c> property is copied, otherwise not.</param>
        public void AssignProperties(PwEntry peTemplate, bool bOnlyIfNewer,
                                     bool bIncludeHistory, bool bAssignLocationChanged)
        {
            if (peTemplate == null)
            {
                Debug.Assert(false); throw new ArgumentNullException("peTemplate");
            }

            if (bOnlyIfNewer && (TimeUtil.Compare(peTemplate.m_tLastMod,
                                                  m_tLastMod, true) < 0))
            {
                return;
            }

            // Template UUID should be the same as the current one
            Debug.Assert(Uuid.Equals(peTemplate.Uuid));
            Uuid = peTemplate.Uuid;

            if (bAssignLocationChanged)
            {
                m_tParentGroupLastMod = peTemplate.m_tParentGroupLastMod;
            }

            m_dStrings    = peTemplate.m_dStrings.CloneDeep();
            m_dBinaries   = peTemplate.m_dBinaries.CloneDeep();
            m_cfgAutoType = peTemplate.m_cfgAutoType.CloneDeep();
            if (bIncludeHistory)
            {
                m_lHistory = peTemplate.m_lHistory.CloneDeep();
            }

            m_pwIcon       = peTemplate.m_pwIcon;
            m_puCustomIcon = peTemplate.m_puCustomIcon;             // Immutable

            m_clrForeground = peTemplate.m_clrForeground;
            m_clrBackground = peTemplate.m_clrBackground;

            m_tCreation   = peTemplate.m_tCreation;
            m_tLastMod    = peTemplate.m_tLastMod;
            m_tLastAccess = peTemplate.m_tLastAccess;
            m_tExpire     = peTemplate.m_tExpire;
            m_bExpires    = peTemplate.m_bExpires;
            m_uUsageCount = peTemplate.m_uUsageCount;

            m_strOverrideUrl = peTemplate.m_strOverrideUrl;

            m_lTags = new List <string>(peTemplate.m_lTags);

            m_dCustomData = peTemplate.m_dCustomData.CloneDeep();
        }
            public override bool Equals(Object obj)
            {
                if (this == obj)
                {
                    return(true);
                }
                if (obj == null || GetType() != obj.GetType())
                {
                    return(false);
                }

                var that = obj as Configuration;

                return(Uuid.Equals(that.Uuid) && Major == that.Major && Minor == that.Minor && Period == that.Period && RxPower == that.RxPower && TxPower == that.TxPower);
            }
Пример #28
0
        /// <summary>
        /// Returns true if Location instances are equal
        /// </summary>
        /// <param name="other">Instance of Location to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Location other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     Identifier == other.Identifier ||
                     Identifier != null &&
                     Identifier.Equals(other.Identifier)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     OperationalStatus == other.OperationalStatus ||
                     OperationalStatus != null &&
                     OperationalStatus.Equals(other.OperationalStatus)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Alias == other.Alias ||
                     Alias != null &&
                     Alias.SequenceEqual(other.Alias)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ));
        }
Пример #29
0
        /// <summary>
        /// Returns true if Team instances are equal
        /// </summary>
        /// <param name="other">Instance of Team to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Team other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     Code == other.Code ||
                     Code != null &&
                     Code.Equals(other.Code)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     DefaultLocation == other.DefaultLocation ||
                     DefaultLocation != null &&
                     DefaultLocation.Equals(other.DefaultLocation)
                 ) &&
                 (
                     CurrentLocation == other.CurrentLocation ||
                     CurrentLocation != null &&
                     CurrentLocation.Equals(other.CurrentLocation)
                 ) &&
                 (
                     Members == other.Members ||
                     Members != null &&
                     Members.SequenceEqual(other.Members)
                 ));
        }
        /// <summary>
        /// Returns true if Qualification instances are equal
        /// </summary>
        /// <param name="other">Instance of Qualification to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Qualification other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     Code == other.Code ||
                     Code != null &&
                     Code.Equals(other.Code)
                 ) &&
                 (
                     Text == other.Text ||
                     Text != null &&
                     Text.Equals(other.Text)
                 ) &&
                 (
                     Period == other.Period ||
                     Period != null &&
                     Period.Equals(other.Period)
                 ) &&
                 (
                     Issuer == other.Issuer ||
                     Issuer != null &&
                     Issuer.Equals(other.Issuer)
                 ) &&
                 (
                     Creation == other.Creation ||
                     Creation != null &&
                     Creation.Equals(other.Creation)
                 ) &&
                 (
                     LastUpdated == other.LastUpdated ||
                     LastUpdated != null &&
                     LastUpdated.Equals(other.LastUpdated)
                 ));
        }
Пример #31
0
        public void Equals_SameType_SameObjects_SameAsGuid(byte[] correctBytes)
        {
            Assert.Multiple(() =>
            {
                Assert.AreEqual(16, correctBytes.Length);

                var uuid1 = new Uuid(correctBytes);
                var uuid2 = new Uuid(correctBytes);

                var guid1 = new Guid(correctBytes);
                var guid2 = new Guid(correctBytes);

                Assert.IsTrue(guid1.Equals(guid2));
                Assert.IsTrue(uuid1.Equals(uuid2));
            });
        }
        /// <summary>
        /// Returns true if SecurityContractDefaultConfigurationTeam instances are equal
        /// </summary>
        /// <param name="other">Instance of SecurityContractDefaultConfigurationTeam to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SecurityContractDefaultConfigurationTeam other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Users == other.Users ||
                     Users != null &&
                     other.Users != null &&
                     Users.SequenceEqual(other.Users)
                 ) &&
                 (
                     Teams == other.Teams ||
                     Teams != null &&
                     other.Teams != null &&
                     Teams.SequenceEqual(other.Teams)
                 ) &&
                 (
                     DataPolicies == other.DataPolicies ||
                     DataPolicies != null &&
                     other.DataPolicies != null &&
                     DataPolicies.SequenceEqual(other.DataPolicies)
                 ));
        }
Пример #33
0
        public void ShouldNotEqualNull()
        {
            var uuid = new Uuid(1, 2);

            Assert.IsFalse(uuid.Equals(null));
        }
Пример #34
0
        public void ShouldEqualSimilarUuid()
        {
            var uuid = new Uuid(1, 2);

            Assert.IsTrue(uuid.Equals(new Uuid(1, 2)));
        }
Пример #35
0
        public void ShouldNotEqualOtherType()
        {
            var uuid = new Uuid(1, 2);

            Assert.IsFalse(uuid.Equals(new object()));
        }
Пример #36
0
        public void ShouldNotEqualOtherUuid()
        {
            var uuid = new Uuid(1, 2);

            Assert.IsFalse(uuid.Equals(new Uuid(3, 4)));
        }