Example #1
0
        public void EqualsShouldCheckTitleAndAuthor()
        {
            var left = new DocumentReference {
                Title = "a", Author = "b"
            };
            var right = new DocumentReference {
                Title = "a", Author = "b"
            };

            Assert.AreEqual(left, right);
            Assert.IsTrue(left.Equals(right));
            Assert.AreEqual(left.GetHashCode(), right.GetHashCode());
        }
Example #2
0
 public bool Equals(DocumentReferenceWrapper?other)
 {
     if (ReferenceEquals(other, null))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     if (GetType() != other.GetType())
     {
         return(false);
     }
     if (ReferenceEquals(_documentReference, other._documentReference))
     {
         return(true);
     }
     return(_documentReference.Equals(other._documentReference));
 }