|
From: Mike M. <mik...@gm...> - 2006-03-01 16:54:40
|
On 2/23/06, Nat Pryce <nat...@gm...> wrote:
>
> You need to pass a custom matcher to the With method, since you want
> to match on a single argument.
>
> E.g. create a EqualListsMatcher that checks if two lists are equal.
> Write a convenient factory function to create it, then use it in an
> expectation like:
>
> On(mock).Method("Foo").With(ListEqualTo(someList)).Will(Return.Value
> (10));
>
We had the same problem on our projects and I created a ComparableList<T>
class that overrode equals and did the right thing, but the matcher looks
much more like it's the right thing to do.
Is this something we should implement directly in NMock2 instead of
requiring folks to implement their own ListEqualTo() matcher?
Cheers,
Mike.
|