|
From: Steve M. <Ste...@ty...> - 2007-10-15 12:58:33
|
I actually very rarely use actions in my test code. The biggest purpose
of my class was for the common actions of firing an event and setting
parameters, which are pretty straightforward and will benefit from the
readability I think.
-----Original Message-----
From: nmo...@li...
[mailto:nmo...@li...] On Behalf Of Nat
Pryce
Sent: Sunday, October 14, 2007 6:13 AM
To: NMock2 Development Discussion
Subject: Re: [NMock2-Dev] Fire syntax
What about error messages? It looks convenient to write, but does it
generate useful diagnostics when tests fail? What is the name of an
anonymous delegate?
JMock and NMock2 were designed favour ease of maintenance over ease of
writing. E.g. when writing a test it's worth spending a couple of
minutes writing a new action class that can generate good error
messages to save a couple of hours debugging time later in the project
when that test fails unexpectedly.
--Nat
On 14/10/2007, Andrey Shchekin <as...@gm...> wrote:
> On 10/14/07, Steve Mitcham <Ste...@ty...> wrote:
> > 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
> >
> > .Will(Cause.Action(()=3D> DoSomething();)); // At least I think that
would
> > be the syntax.
>
> That is cool, but that is one part.
>
> I actually passed the original method parameters to the Action so you
> could provide full method implementation. I also passed the return
> value back if there was one (in this case delegate was not Action, of
> course).
>
> I am attaching code for the Be class to demonstrate the point.
>
>
------------------------------------------------------------------------
-
> 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
>
>
>
------------------------------------------------------------------------
-
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
|