|
From: Steve M. <Ste...@ty...> - 2008-01-23 16:09:55
|
I've looked a jMock's implementation and I've looked at Rhino. I don't
really like the two line setups with the Call/LastCall that is the same
as the Rhino expectations. I'm trying to think of an 'NMock-like'
implementation of the same thing that keeps the fluent interface going.
=20
What I was thinking about was something along the lines of
=20
Expect.Once.On(m_foo).Will(Return.Value("X")).From.MethodOnFoo("bar");
=20
=20
>From will return a generated implementation of the IFoo interface that
will build the mocks.
=20
I can't, however think of a good pattern for doing property gets and
event handlers.
=20
Property sets are the same as the methods
=20
Expect.Once.On(m_foo).From.PropertyOnFoo =3D 6;
=20
It would be clunky, but we could have
=20
Expect.Once.On(m_foo).Get.From.PropertyOnFoo =3D 4; // 4 would be the
return value.
=20
Like I said, I don't like the property get.
=20
|