|
From: Steve M. <Ste...@ty...> - 2007-10-13 22:13:50
|
I see what you are saying with the delegate now. I think that we get
that into the action by adding an action delegate with no parameters and
allow an anonymous method to be added perhaps something like
.Will(Cause.Action(new delegate { DoSomething(); }))
And later in 3.5=20
.Will(Cause.Action(()=3D> DoSomething();)); // At least I think that =
would
be the syntax.
-----Original Message-----
From: nmo...@li...
[mailto:nmo...@li...] On Behalf Of Andrey
Shchekin
Sent: Saturday, October 13, 2007 4:54 PM
To: NMock2 Development Discussion
Subject: Re: [NMock2-Dev] Fire syntax
On 10/14/07, Steve Mitcham <Ste...@ty...> wrote:
> Your syntax adds complexity to the API without benefit. There is
> nothing stopping you from calling your own 'new MyAction()' or 'new
> delegate(){}' at the Will clause in the call.
I can not use delegate() since Will does not receive delegates (at
least in the last release). But I agree that my suggestion is nowhere
near being nice to implement, it's just an idea.
> Also, for the Change instead of Cause, we are not changing parameters
> we are setting them. I agree that ToBe might be hard to remember, but
> that's what intellisense is for :) and once written it reads very
well.
Well, strictly speaking, we change them since thay can be ref not out.
;)
But that's nitpicking.
After some thinking, I agree that Cause is a good choice.
Change is a possible collision trap for other fluent frameworks, and
single Parameter method is not enough to justify it.
------------------------------------------------------------------------
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NMock-two-dev mailing list
NMo...@li...
https://lists.sourceforge.net/lists/listinfo/nmock-two-dev
|