|
From: Mike C. <mik...@gm...> - 2008-01-23 18:09:27
|
On 23/01/2008, Steve Mitcham <Ste...@ty...> wrote:
>[snip]
>Expect.Once.On(m_foo).Will(Return.Value("X")).From.MethodOnFoo("bar");
>Expect.Once.On(m_foo).From.PropertyOnFoo = 6;
>Expect.Once.On(m_foo).Get.From.PropertyOnFoo = 4; // 4 would be the
return value.
>[snip]
I don't think "From" reads well in the general case. Your method
example sounds fluent if you read it as "Will ReturnSomething From",
but the structure is "Will (ArbitrarySetOfActions) From" which makes
less sense, and where there's no Will clause the "From" on its own is
downright confusing.
How about
Expect.Once.On(foo).Method.Blah.With(123).Will(...);
Expect.Once.On(foo).Setter.Plonk.With(123);
Expect.Once.On(foo).Getter.Squee.Will(...);
where Method, Setter and Getter all return your generated IFoo?
- Mike
|