The use of "Matches" on the RegexConstraint is a remnant of an earlier
syntax and should be removed. The current syntax is "Does.Match(string
pattern)", which generates a RegexConstraint.
However, Aaron is talking about something else, the
PredicateConstraint, which allows matching an arbitrary predicate,
including lambdas. I once had great hopes for that approach as a way
to move us to a new syntax, but it never caught on. Currently, it
appears that PredicateConstraint still exists and Matches can be used
but only in the course of a constraint expression. That is, you can
use this...
Assert.That(123, Is.TypeOf<int>().And.Matches<int>((int x) => x > 100));
but you can't have the PredicateConstraint (easily) all by itself.
I'm not sure whether there was once more and it was removed or if the
full implementation was never done. I suggest creating an issue if you
would like to see something happen.
Charlie
> --
> You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
nunit-discus...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/nunit-discuss/d9d023b4-dd44-4795-87b0-20760bcbd863%40googlegroups.com.