|
From: Andrey S. <as...@gm...> - 2007-10-13 08:25:55
|
> To complete the discussion the Cause will also have
>
> Expect.Once.On(mock).Method("MethodWithRefParameters").With(Is.Out).Will
> (Cause.NamedParameter("foo").ToBe("bar"));
>
> Expect.Once.On(mock).Method("MethodWithRefParameters").With(Is.Out).Will
> (Cause.IndexedParameter(0).ToBe("bar""));
I used Will(Set.Parameter("foo").To("bar")), but this, of course, will
have problems in VB where Set is a keyword.
But I think Cause.Parameter(_nameOrIndex_).ToBe(value) would be more
concise. Or, maybe, Change.Parameter.To. While it requires another
root class, it is shorter and easier to remember.
By the way, I also use a Will(Be.A(new Action(delegate() {}))) in my work code.
I am not sure if there is anything similar to this in the current NMock2 code.
|