Пример #1
0
        private static IResolveConstraint GetResolveConstrains(ValidationCase validationCase)
        {
            if (!validationCase.shouldRaiseError)
            {
                return(Throws.Nothing);
            }

            Constraint result = Throws.InstanceOf(validationCase.ExceptionType);

            return(validationCase.exceptionSubstrings.Aggregate(result, (current, line) => current.And.Message.Contains(line)));
        }
Пример #2
0
 public void ExceptionRaiseTest(ValidationCase validationCase)
 {
     Assert.That(new TestDelegate(validationCase.ActionToTest), GetResolveConstrains(validationCase));
 }