public void EqualsOther_ReturnsFalse_WhenOtherIsNull() { var entity = new FakeEntityWithStringId("test"); entity.Equals(null).ShouldBeFalse(); }
public void EqualsOther_ReturnsTrue_WhenOtherIsSameReference() { var entity = new FakeEntityWithStringId("test"); entity.Equals(entity).ShouldBeTrue(); }
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); }