Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#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