public void RangeInvalid() { var v = new temp { RequiredString = "str", Range = 1 } .IsValid(); var r = v.Model(); Assert.IsFalse(v.IsValid); Assert.AreEqual(1, v.Errors.Count()); }
public void ExecuteRequiredStringValidator() { var v = new temp { RequiredString = null, Range = 50 } .IsValid(); var r = v.Model(); Assert.IsFalse(r); Assert.IsFalse(v.IsValid); Assert.AreEqual(1, v.Errors.Count()); }
public void ExecuteRequiredStringValidatorIsValid() { var v = new temp { RequiredString = "string", Range = 50 } .IsValid(); var r = v.Model(); Assert.IsTrue(r); Assert.IsTrue(v.IsValid); Assert.AreEqual(0, v.Errors.Count()); }
public void ValidationMessagesSet() { var validatable = new temp { RequiredString = null, Range = 0 } .IsValid(); var r = validatable.Model(); Assert.IsFalse(r); Assert.AreEqual(2, validatable.Errors.Count()); }