|
From: Steve M. <Ste...@ty...> - 2007-10-13 20:39:41
|
I'm trying to avoid calling new in the fluent interface part, but I do
agree that just having one Parameter() method that accepts either an
index or a name.
-----Original Message-----
From: nmo...@li...
[mailto:nmo...@li...] On Behalf Of Andrey
Shchekin
Sent: Saturday, October 13, 2007 3:26 AM
To: NMock2 Development Discussion
Subject: Re: [NMock2-Dev] Fire syntax
> 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.
------------------------------------------------------------------------
-
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
|