Validate() public method

Validate the instance and populate any warnings and errors into the validationMessages string builder.
public Validate ( StringBuilder validationMessages ) : bool
validationMessages StringBuilder A non-null string builder that will be appended to for any messages.
return bool
コード例 #1
0
 public void ValidateShouldThrowGivenNullValidationMessages()
 {
     var subject = new GlobalFilterCriteria { BeginDate = new DateTime(), EndDate = DateTime.Now };
     Assert.IsFalse(subject.Validate(null));
 }
コード例 #2
0
 public void ValidateShouldReturnTrueGivenCleared()
 {
     var subject = new GlobalFilterCriteria();
     Assert.IsTrue(subject.Cleared);
     Assert.IsTrue(subject.Validate(this.validationMessages));
 }
コード例 #3
0
 public void ValidateShouldReturnTrueGivenDatesButNoAccount()
 {
     var subject = new GlobalFilterCriteria { BeginDate = DateTime.Today.AddDays(-1), EndDate = DateTime.Now };
     Assert.IsFalse(subject.Cleared);
     Assert.IsTrue(subject.Validate(this.validationMessages));
 }
コード例 #4
0
 public void ValidateShouldReturnFalseGivenEndDateIsNull()
 {
     var subject = new GlobalFilterCriteria { BeginDate = DateTime.Today.AddDays(-1), EndDate = DateTime.Now };
     subject.EndDate = null;
     Assert.IsFalse(subject.Validate(this.validationMessages));
 }