|
From: Mike C. <mik...@gm...> - 2007-08-16 10:43:08
|
Currently, ExpectationBuilder's "With" and friends take either an
array of Matchers or an array of objects which are converted to
EqualMatchers.
The problem with this is that if I have a "With(1, 2, 3, 4, 5)"
expectation and I want to replace the 5 with some other Matcher, I
have to explicitly convert all of the other arguments to explicit
Matchers as well. There's no good reason for this as far as I can see,
and it's a usability regression from NMock1. I'd therefore like to
change this to allow Matchers and non-matchers to be mixed. Matchers
are used as is; non-Matchers are converted to EqualMatchers as they
are today.
The change wouldn't break anything that worked before unless a test
was explicitly expecting Matcher argument values, which isn't likely
to happen and is still expressible via Is.EqualTo(myMatcher) if it
does.
I appreciate that "if (x is Matcher) {} else {}" has an odour to it,
but I don't think that in itself justifies throwing the user off a
convenience cliff in this case.
Any objections?
Mike
|