public void IsValidReturnsFalseForEmptyGuid() { IValidationRule <FakeObjectToValidate> rule = new GuidMustBeValidRule <FakeObjectToValidate>(f => f.Guid, "FakeGuid"); bool isValid = rule.IsValid(new FakeObjectToValidate()); Assert.IsFalse(isValid, "IsValid returned true for empty guid."); }
public void IsValidReturnsFalseWhenGivenNullObjectToCheck() { IValidationRule <FakeObjectToValidate> rule = new GuidMustBeValidRule <FakeObjectToValidate>(f => f.Guid, "FakeGuid"); bool isValid = rule.IsValid(null); Assert.IsFalse(isValid, "IsValid returned true for null object."); }
public void IsValidReturnsTrueForGuidThatIsNotEqualToEmptyGuid() { IValidationRule <FakeObjectToValidate> rule = new GuidMustBeValidRule <FakeObjectToValidate>(f => f.Guid, "FakeGuid"); bool isValid = rule.IsValid(new FakeObjectToValidate { Guid = Guid.NewGuid() }); Assert.IsTrue(isValid, "IsValid returned false for guid that did not equal empty guid."); }