Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
States vs. InOrder verification
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
James Carr  
View profile  
 More options Apr 24 2010, 4:13 pm
From: James Carr <james.r.c...@gmail.com>
Date: Sat, 24 Apr 2010 16:13:09 -0400
Local: Sat, Apr 24 2010 4:13 pm
Subject: [mockito] States vs. InOrder verification
I recently finished up Steve and Nat's book and on thing of interest
that he introcduced was using the concept of states
(http://www.jmock.org/states.html) rather than verifying interactions
occur in order. Essentially, when different interactions occur you can
say that the object is in a certain "state" and then verify that
state. This makes a lot of sense for the same reasons I never ever use
the InOrder verifications in mockito... in my experience InOrder
verifications either indicate some very procedural logic or in the
cases where it might seem to be relevant the tests produced with it
are often very brittle.

After seeing several examples of "state" based verification, I like it
and I keep thinking... how could we introduce a similar feature in
mockito? As another method tacked on to givne/when maybe? Something
like

when(foo.pushDown()).thenStateIs("down");
when(foo.pushDown()).thenStateIs("up");

or

given(foo.pushDown()).thenStateIs("down");
given(foo.pushDown()).thenStateIs("up");

Just a thought.

Thanks,
James

--
You received this message because you are subscribed to the Google Groups "mockito" group.
To post to this group, send email to mockito@googlegroups.com.
To unsubscribe from this group, send email to mockito+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mockito?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Bartling  
View profile  
 More options Apr 24 2010, 9:08 pm
From: Chris Bartling <chris.bartl...@gmail.com>
Date: Sat, 24 Apr 2010 20:08:09 -0500
Local: Sat, Apr 24 2010 9:08 pm
Subject: Re: [mockito] States vs. InOrder verification

On a related note, if you haven't had a chance to read Steve and Nat's book,
it quite good.  One of my favorites for 2009.  Well worth the read.

http://www.growing-object-oriented-software.com/

Regards,

-- chris --

--
You received this message because you are subscribed to the Google Groups "mockito" group.
To post to this group, send email to mockito@googlegroups.com.
To unsubscribe from this group, send email to mockito+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mockito?hl=en.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
szczepiq  
View profile  
 More options Apr 27 2010, 10:46 am
From: szczepiq <szcze...@gmail.com>
Date: Tue, 27 Apr 2010 16:46:52 +0200
Local: Tues, Apr 27 2010 10:46 am
Subject: Re: [mockito] States vs. InOrder verification

Hey


when(foo.pushDown()).thenStateIs("down");
when(foo.pushDown()).thenStateIs("up");

I'm not sure how it fits Mockito. You would need some verification mechanism
afterwards, like verifyStates(); Also you need some constraining mechanism
for defining states :) like
when(foo.pushDown()).inState("down").thenStateIs("up");

It would be good to see a real example where it is useful.

Cheers!
Szczepan

--
You received this message because you are subscribed to the Google Groups "mockito" group.
To post to this group, send email to mockito@googlegroups.com.
To unsubscribe from this group, send email to mockito+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mockito?hl=en.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »