3 #define NUNIT_FRAMEWORK
9 namespace NUnit.Framework.Constraints
11 internal class ExceptionNotThrownConstraint : Constraint
14 /// The Description of what this constraint tests, for
15 /// use in messages and in the ConstraintResult.
17 public override string Description
19 get { return "No Exception to be thrown"; }
23 /// Applies the constraint to an actual value, returning a ConstraintResult.
25 /// <param name="actual">The value to be tested</param>
26 /// <returns>A ConstraintResult</returns>
27 public override ConstraintResult ApplyTo<TActual>(TActual actual)
29 var exception = actual as Exception;
30 return new ConstraintResult(this, exception, exception == null);