Example #1
0
        public void EqualsOther_ReturnsFalse_WhenOtherIsNull()
        {
            var entity = new FakeEntityWithStringId("test");

            entity.Equals(null).ShouldBeFalse();
        }
Example #2
0
        public void EqualsOther_ReturnsTrue_WhenOtherIsSameReference()
        {
            var entity = new FakeEntityWithStringId("test");

            entity.Equals(entity).ShouldBeTrue();
        }
Example #3
0
 public void GetHashCode_ReturnsHashCodeOStringfId_OrZeroWhenIdIsNull(string id)
 {
     var entity = new FakeEntityWithStringId(id);
     var hashCode = entity.GetHashCode();
     hashCode.ShouldEqual(!Equals(entity.Id, default(string)) ? entity.Id.GetHashCode() : 0);
 }