public void Set_IdentityValue_throws_when_an_invalid_value_is_provided(LongIdEntity entity) { Assert.That(() => { IEntity castIdentity = entity; castIdentity.IdentityValue = "Not a number"; }, Throws.Exception); }
public bool GetDateTimeCondition(LongIdEntity n) { if ((EndTime == DateTime.MinValue) || (EndTime < StartTime)) { EndTime = DateTime.MaxValue; } if (EndTime < DateTime.MaxValue) { EndTime = EndTime.AddDays(1); } return(n.CreationDate >= StartTime && n.CreationDate < EndTime); }
public void Set_IdentityValue_using_value_which_implicitly_casts_to_identity_value_type_sets_correct_value(int newIdentity, LongIdEntity entity) { Assert.That(() => { IEntity castIdentity = entity; castIdentity.IdentityValue = newIdentity; return(castIdentity.IdentityValue); }, Is.EqualTo(newIdentity)); }
public void Set_IdentityValue_does_not_throw_for_value_which_may_implicitly_cast_to_identity_value_type(int newIdentity, LongIdEntity entity) { Assert.That(() => { IEntity castIdentity = entity; castIdentity.IdentityValue = newIdentity; }, Throws.Nothing); }