#15 Create DelegateMatcher

open
nobody
None
5
2007-07-10
2007-07-10
No

Create a matcher that receives a delegate that performs the matching. This would avoid creation of custom matchers for many common scenarios (i.e. lazy check on property values, etc.).

Expect.Once.On(foo).With(new DelegateMatcher(delegate { return bar.Value == "hello"; }));

Note that with C# 3.0 syntax it will look much better:

Expect.Once.On(foo).With(new DelegateMatcher(() => bar.Value == "hello"));

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks