コード例 #1
0
 public void GetResultAsyncShouldReturnFailIfDateTimeIsAfterEnd(DateTimeInRange sut, [RuleContext] RuleContext context)
 {
     sut.Start = new DateTime(2001, 1, 1);
     sut.End   = new DateTime(2002, 1, 1);
     Assert.That(() => sut.GetResultAsync(new DateTime(2010, 6, 1), context), Is.FailingValidationResult);
 }
コード例 #2
0
 public void GetResultAsyncShouldReturnPassIfValueIsNull(DateTimeInRange sut, [RuleContext] RuleContext context)
 {
     Assert.That(() => sut.GetResultAsync(null, context), Is.PassingValidationResult);
 }
コード例 #3
0
 public void GetResultAsyncShouldReturnPassIfDateTimeIsWithinRange(DateTimeInRange sut, [RuleContext] RuleContext context)
 {
     sut.Start = new DateTime(2001, 1, 1);
     sut.End   = new DateTime(2002, 1, 1);
     Assert.That(() => sut.GetResultAsync(new DateTime(2001, 6, 1), context), Is.PassingValidationResult);
 }