예제 #1
0
        /// <summary>
        /// Returns true if Person instances are equal
        /// </summary>
        /// <param name="other">Instance of Person to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Person other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     FirstName == other.FirstName ||
                     FirstName != null &&
                     FirstName.Equals(other.FirstName)
                     ) &&
                 (
                     Surname == other.Surname ||
                     Surname != null &&
                     Surname.Equals(other.Surname)
                 ) &&
                 (
                     DateOfBirth == other.DateOfBirth ||
                     DateOfBirth != null &&
                     DateOfBirth.Equals(other.DateOfBirth)
                 ) &&
                 (
                     PersonGender == other.PersonGender ||

                     PersonGender.Equals(other.PersonGender)
                 ) &&
                 (
                     MatchId == other.MatchId ||
                     MatchId != null &&
                     MatchId.Equals(other.MatchId)
                 ) &&
                 (
                     AllocatePersonId == other.AllocatePersonId ||
                     AllocatePersonId != null &&
                     AllocatePersonId.Equals(other.AllocatePersonId)
                 ) &&
                 (
                     Email == other.Email ||
                     Email != null &&
                     Email.Equals(other.Email)
                 ) &&
                 (
                     TelephoneNumber == other.TelephoneNumber ||
                     TelephoneNumber != null &&
                     TelephoneNumber.Equals(other.TelephoneNumber)
                 ) &&
                 (
                     ExtSystemId == other.ExtSystemId ||
                     ExtSystemId != null &&
                     ExtSystemId.Equals(other.ExtSystemId)
                 ));
        }
예제 #2
0
        public void TelephoneNumberIsInequal(
            [Values("1", "2", "3")] string x,
            [Values("01234 567890", "12")] string s)
        {
            var numTelephoneNumber = new TelephoneNumber(x);

            var stringTelephoneNumber = new TelephoneNumber(s);

            Assert.That(numTelephoneNumber, Is.Not.EqualTo(stringTelephoneNumber));

            Assert.That(!numTelephoneNumber.Equals(stringTelephoneNumber));

            Assert.That(numTelephoneNumber != stringTelephoneNumber);
        }
예제 #3
0
        /// <summary>
        /// Returns true if Person instances are equal
        /// </summary>
        /// <param name="other">Instance of Person to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Person other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     UniversalId == other.UniversalId ||
                     UniversalId != null &&
                     UniversalId.Equals(other.UniversalId)
                 ) &&
                 (
                     FirstName == other.FirstName ||
                     FirstName != null &&
                     FirstName.Equals(other.FirstName)
                 ) &&
                 (
                     Surname == other.Surname ||
                     Surname != null &&
                     Surname.Equals(other.Surname)
                 ) &&
                 (
                     Email == other.Email ||
                     Email != null &&
                     Email.Equals(other.Email)
                 ) &&
                 (
                     TelephoneNumber == other.TelephoneNumber ||
                     TelephoneNumber != null &&
                     TelephoneNumber.Equals(other.TelephoneNumber)
                 ) &&
                 (
                     Links == other.Links ||
                     Links != null &&
                     other.Links != null &&
                     Links.SequenceEqual(other.Links)
                 ));
        }
예제 #4
0
 public override bool Equals(object obj)
 {
     return(obj is Contract && TelephoneNumber.Equals(((Contract)obj).TelephoneNumber));
 }
예제 #5
0
 public override bool Equals(object obj)
 {
     return(obj is Port && TelephoneNumber.Equals(((Port)obj).TelephoneNumber));
 }