Пример #1
0
 public void GetResultAsyncShouldReturnFailIfValueDoesNotMatchRegexPattern(MatchesRegex sut, [RuleContext] RuleContext context)
 {
     // In this case we are expecting failure because default regex options are to be case-sensitive
     sut.Pattern = "ABC";
     Assert.That(() => sut.GetResultAsync("123abc123", context), Is.FailingValidationResult);
 }
Пример #2
0
 public void GetResultAsyncShouldReturnPassIfValueMatchesRegexPattern(MatchesRegex sut, [RuleContext] RuleContext context)
 {
     sut.Pattern = "abc";
     Assert.That(() => sut.GetResultAsync("123abc123", context), Is.PassingValidationResult);
 }