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

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

            entity.Equals(entity).ShouldBeTrue();
        }
示例#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);
 }