public void Sets_ErrorMessage_And_Association_When_Decimal_Less_Than_One_Supplied() { var rule = new ValueRequiredRule(0M, "id").Validate(); rule.Association.ShouldBe("id"); rule.ErrorMessage.ShouldBe("id must be greater than 0"); }
public void Sets_ErrorMessage_And_Association_When_String_Empty_Is_Supplied() { var rule = new ValueRequiredRule("", "id").Validate(); rule.Association.ShouldBe("id"); rule.ErrorMessage.ShouldBe("id must be supplied"); }
public void Sets_ErrorMessage_And_Association_When_Null_Is_Supplied() { var rule = new ValueRequiredRule(new Guid(), "id").Validate(); rule.Association.ShouldBe("id"); rule.ErrorMessage.ShouldBe("A valid UUID for id must be supplied"); }
public void Returns_False_When_Decimal_Less_Than_One_Supplied() { var rule = new ValueRequiredRule(0M, "id").Validate(); rule.IsValid.ShouldBe(false); }
public void Returns_True_When_Decimal_Greater_Than_Zero_Supplied() { var rule = new ValueRequiredRule(1M, "id").Validate(); rule.IsValid.ShouldBe(true); }
public void Returns_False_When_Null_Is_Supplied() { var rule = new ValueRequiredRule(new Guid(), "id").Validate(); rule.IsValid.ShouldBe(false); }
public void Returns_True_When_Guid_Non_Empty_Is_Supplied() { var rule = new ValueRequiredRule(Guid.NewGuid(), "id").Validate(); rule.IsValid.ShouldBe(true); }
public void Sets_ErrorMessage_When_Long_Less_Than_One_Supplied() { var rule = new ValueRequiredRule(0L, "id").Validate(); rule.ErrorMessage.ShouldBe("id must be greater than 0"); }
public void SetsErrorMessageWhenStringEmptyIsSupplied() { var rule = new ValueRequiredRule("", "id").Validate(); rule.ErrorMessage.ShouldBe("id must be supplied"); }
public void ReturnsFalseWhenStringEmptyIsSupplied() { var rule = new ValueRequiredRule("", "id").Validate(); rule.IsValid.ShouldBe(false); }
public void ReturnsTrueWhenStringNonEmptyIsSupplied() { var rule = new ValueRequiredRule("123", "id").Validate(); rule.IsValid.ShouldBe(true); }
public void SetsErrorMessageWhenDecimalLessThanOneSupplied() { var rule = new ValueRequiredRule(0M, "id").Validate(); rule.ErrorMessage.ShouldBe("id must be greater than 0"); }
public void ReturnsFalseWhenDecimalLessThanOneSupplied() { var rule = new ValueRequiredRule(0M, "id").Validate(); rule.IsValid.ShouldBe(false); }
public void ReturnsTrueWhenDecimalGreaterThanZeroSupplied() { var rule = new ValueRequiredRule(1M, "id").Validate(); rule.IsValid.ShouldBe(true); }
public void ReturnsTrueWhenGuidNonEmptyIsSupplied() { var rule = new ValueRequiredRule(Guid.NewGuid(), "id").Validate(); rule.IsValid.ShouldBe(true); }
public void Returns_True_When_String_Non_Empty_Is_Supplied() { var rule = new ValueRequiredRule("123", "id").Validate(); rule.IsValid.ShouldBe(true); }
public void Returns_False_When_String_Empty_Is_Supplied() { var rule = new ValueRequiredRule("", "id").Validate(); rule.IsValid.ShouldBe(false); }
public void Sets_ErrorMessage_When_Guid_Empty_Is_Supplied() { var rule = new ValueRequiredRule(new Guid(), "id").Validate(); rule.ErrorMessage.ShouldBe("id must be supplied"); }