<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Arrange Act Assert and BDD specifications</title>
	<atom:link href="http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/</link>
	<description>Strong opinions, weakly held</description>
	<lastBuildDate>Sat, 25 May 2013 16:53:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: BDD: Links, News and Resources (1) &#171; Angel &#8220;Java&#8221; Lopez on Blog</title>
		<link>http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/#comment-4158</link>
		<dc:creator>BDD: Links, News and Resources (1) &#171; Angel &#8220;Java&#8221; Lopez on Blog</dc:creator>
		<pubDate>Tue, 29 Nov 2011 09:37:35 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/07/24/arrange-act-assert-and-bdd-specifications.aspx#comment-4158</guid>
		<description>[...] Arrange Act Assert and BDD specifications http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/ [...]</description>
		<content:encoded><![CDATA[<p>[...] Arrange Act Assert and BDD specifications <a href="http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/" rel="nofollow">http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rhino Mocks &#124; My Blog</title>
		<link>http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/#comment-3785</link>
		<dc:creator>Rhino Mocks &#124; My Blog</dc:creator>
		<pubDate>Thu, 01 Sep 2011 14:58:08 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/07/24/arrange-act-assert-and-bdd-specifications.aspx#comment-3785</guid>
		<description>[...] http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/" rel="nofollow">http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmy Bogard</title>
		<link>http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/#comment-704</link>
		<dc:creator>Jimmy Bogard</dc:creator>
		<pubDate>Tue, 23 Sep 2008 11:45:47 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/07/24/arrange-act-assert-and-bdd-specifications.aspx#comment-704</guid>
		<description>@joey

Yep, you&#039;re right.  We&#039;ve been doing the latter example in practice.  I like asserting individual method calls rather than a bunch of expectations.</description>
		<content:encoded><![CDATA[<p>@joey</p>
<p>Yep, you&#8217;re right.  We&#8217;ve been doing the latter example in practice.  I like asserting individual method calls rather than a bunch of expectations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joey</title>
		<link>http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/#comment-703</link>
		<dc:creator>joey</dc:creator>
		<pubDate>Tue, 23 Sep 2008 10:22:20 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/07/24/arrange-act-assert-and-bdd-specifications.aspx#comment-703</guid>
		<description>Hrmm I agree with Simone, the last code block with AAA syntax looks off according to the documentation at least

Since you are creating a &quot;mock&quot; object for the SmtpClient, you need to verify the expectations that you set on it.

So the arrangement would be:

[code]
&lt;pre&gt;
protected override void EstablishContext()
    {
        _mockClient = Dependency&lt;ISmtpClient&gt;();
        IOrderSpec stubSpec = Stub&lt;IOrderSpec&gt;();

        _order = new Order();
        _order.Total = 201.0m;

        stubSpec.Stub(x =&gt; x.IsMatch(_order)).Return(true);
       
       //expectation up here
      _mockClient.Expect(x =&gt; x.Send(Arg&lt;MailMessage&gt;.Matches(msg =&gt; msg.To[0].Address == &quot;salesdude@email.com&quot;)));
        _orderProcessor = new OrderProcessor(_mockClient, stubSpec);
    }

    protected override void Because()
    {
        _orderProcessor.PlaceOrder(_order);
    }

    [Test]
    public void Should_send_the_email_to_the_sales_guy()
    {
        _mockClient.VerifyAllExpectations();
    }

[/code]
&lt;/pre&gt;

If you wanted the AAA they would both have to be &quot;Stubs&quot; and in the Assert block you can have: 
&lt;pre&gt;
[Test]
    public void Should_send_the_email_to_the_sales_guy()
    {
       _stubClient.AssertWasCalled(x=&gt;x.Send( ...));
    }
&lt;/pre&gt;

This is coming from reading this post:
http://ayende.com/Blog/archive/2008/05/16/Rhino-Mocks--Arrange-Act-Assert-Syntax.aspx

and documentation here:
http://ayende.com/wiki/Rhino+Mocks+3.5.ashx#Arrange,Act,Assert

</description>
		<content:encoded><![CDATA[<p>Hrmm I agree with Simone, the last code block with AAA syntax looks off according to the documentation at least</p>
<p>Since you are creating a &#8220;mock&#8221; object for the SmtpClient, you need to verify the expectations that you set on it.</p>
<p>So the arrangement would be:</p>
<p>[code]</p>
<pre>
protected override void EstablishContext()
    {
        _mockClient = Dependency<ismtpclient>();
        IOrderSpec stubSpec = Stub<iorderspec>();

        _order = new Order();
        _order.Total = 201.0m;

        stubSpec.Stub(x => x.IsMatch(_order)).Return(true);
       
       //expectation up here
      _mockClient.Expect(x => x.Send(Arg<mailmessage>.Matches(msg => msg.To[0].Address == "salesdude@email.com")));
        _orderProcessor = new OrderProcessor(_mockClient, stubSpec);
    }

    protected override void Because()
    {
        _orderProcessor.PlaceOrder(_order);
    }

    [Test]
    public void Should_send_the_email_to_the_sales_guy()
    {
        _mockClient.VerifyAllExpectations();
    }

[/code]
</mailmessage></iorderspec></ismtpclient></pre>
<p>If you wanted the AAA they would both have to be &#8220;Stubs&#8221; and in the Assert block you can have: </p>
<pre>
[Test]
    public void Should_send_the_email_to_the_sales_guy()
    {
       _stubClient.AssertWasCalled(x=>x.Send( ...));
    }
</pre>
<p>This is coming from reading this post:<br />
<a href="http://ayende.com/Blog/archive/2008/05/16/Rhino-Mocks--Arrange-Act-Assert-Syntax.aspx" rel="nofollow">http://ayende.com/Blog/archive/2008/05/16/Rhino-Mocks&#8211;Arrange-Act-Assert-Syntax.aspx</a></p>
<p>and documentation here:<br />
<a href="http://ayende.com/wiki/Rhino+Mocks+3.5.ashx#Arrange,Act,Assert" rel="nofollow">http://ayende.com/wiki/Rhino+Mocks+3.5.ashx#Arrange,Act,Assert</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simone Busoli</title>
		<link>http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/#comment-702</link>
		<dc:creator>Simone Busoli</dc:creator>
		<pubDate>Sun, 03 Aug 2008 14:42:48 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/07/24/arrange-act-assert-and-bdd-specifications.aspx#comment-702</guid>
		<description>I think the _client.Expect call should be replaced with _client.AssertWasCalled. Are you sure it&#039;s really verifying it&#039;s been called?</description>
		<content:encoded><![CDATA[<p>I think the _client.Expect call should be replaced with _client.AssertWasCalled. Are you sure it&#8217;s really verifying it&#8217;s been called?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morten Lyhr</title>
		<link>http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/#comment-701</link>
		<dc:creator>Morten Lyhr</dc:creator>
		<pubDate>Sat, 26 Jul 2008 08:42:34 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/07/24/arrange-act-assert-and-bdd-specifications.aspx#comment-701</guid>
		<description>Whoops... wrong url :-)

I wrote about it here:
http://morten.lyhr.dk/2008/07/doing-bdd-with-rhino-mocks-aaa-syntax.html</description>
		<content:encoded><![CDATA[<p>Whoops&#8230; wrong url <img src='http://lostechies.com/jimmybogard/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I wrote about it here:<br />
<a href="http://morten.lyhr.dk/2008/07/doing-bdd-with-rhino-mocks-aaa-syntax.html" rel="nofollow">http://morten.lyhr.dk/2008/07/doing-bdd-with-rhino-mocks-aaa-syntax.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morten Lyhr</title>
		<link>http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/#comment-700</link>
		<dc:creator>Morten Lyhr</dc:creator>
		<pubDate>Sat, 26 Jul 2008 08:41:36 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/07/24/arrange-act-assert-and-bdd-specifications.aspx#comment-700</guid>
		<description>I wrote about Rhino Mocks 3.5 AAA and BDD here:
http://morten.lyhr.dk/2008/07/doing-bdd-when-expecting-exception.html</description>
		<content:encoded><![CDATA[<p>I wrote about Rhino Mocks 3.5 AAA and BDD here:<br />
<a href="http://morten.lyhr.dk/2008/07/doing-bdd-when-expecting-exception.html" rel="nofollow">http://morten.lyhr.dk/2008/07/doing-bdd-when-expecting-exception.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmy Bogard</title>
		<link>http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/#comment-699</link>
		<dc:creator>Jimmy Bogard</dc:creator>
		<pubDate>Thu, 24 Jul 2008 22:23:07 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/07/24/arrange-act-assert-and-bdd-specifications.aspx#comment-699</guid>
		<description>@Joe, Victor and John

The ContextSpecification comes from a version of NBehave I still haven&#039;t committed to the trunk.  I&#039;ll push it out soon after a few more tweaks.</description>
		<content:encoded><![CDATA[<p>@Joe, Victor and John</p>
<p>The ContextSpecification comes from a version of NBehave I still haven&#8217;t committed to the trunk.  I&#8217;ll push it out soon after a few more tweaks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Victor Kornov</title>
		<link>http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/#comment-698</link>
		<dc:creator>Victor Kornov</dc:creator>
		<pubDate>Thu, 24 Jul 2008 19:45:06 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/07/24/arrange-act-assert-and-bdd-specifications.aspx#comment-698</guid>
		<description>@Joe
I believe ContextSpecification  comes from NBehave. Also, look for it here http://blog.jpboodhoo.com/BDDAAAStyleTestingAndRhinoMocks.aspx</description>
		<content:encoded><![CDATA[<p>@Joe<br />
I believe ContextSpecification  comes from NBehave. Also, look for it here <a href="http://blog.jpboodhoo.com/BDDAAAStyleTestingAndRhinoMocks.aspx" rel="nofollow">http://blog.jpboodhoo.com/BDDAAAStyleTestingAndRhinoMocks.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Ocampo</title>
		<link>http://lostechies.com/jimmybogard/2008/07/24/arrange-act-assert-and-bdd-specifications/#comment-697</link>
		<dc:creator>Joe Ocampo</dc:creator>
		<pubDate>Thu, 24 Jul 2008 18:58:21 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2008/07/24/arrange-act-assert-and-bdd-specifications.aspx#comment-697</guid>
		<description>Is ContextSpecification your own base class? Or is it part of ....?</description>
		<content:encoded><![CDATA[<p>Is ContextSpecification your own base class? Or is it part of &#8230;.?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
