<?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: TDD: Mock expectations in Setup</title>
	<atom:link href="http://www.markhneedham.com/blog/2008/12/19/tdd-mock-expectations-in-setup/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markhneedham.com/blog/2008/12/19/tdd-mock-expectations-in-setup/</link>
	<description>Thoughts on Software Development</description>
	<lastBuildDate>Sat, 11 Feb 2012 23:17:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Coding: Paying attention at Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2008/12/19/tdd-mock-expectations-in-setup/comment-page-1/#comment-36411</link>
		<dc:creator>Coding: Paying attention at Mark Needham</dc:creator>
		<pubDate>Sun, 09 May 2010 13:11:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=755#comment-36411</guid>
		<description>[...] Another somewhat related situation where I&#039;ve noticed a similar problem is when we have several tests which require a certain method to be stubbed out and in the interests of reducing duplication we pull that up into a setup method. [...]</description>
		<content:encoded><![CDATA[<p>[...] Another somewhat related situation where I&#39;ve noticed a similar problem is when we have several tests which require a certain method to be stubbed out and in the interests of reducing duplication we pull that up into a setup method. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TDD: Asserting on test dependency code at Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2008/12/19/tdd-mock-expectations-in-setup/comment-page-1/#comment-21557</link>
		<dc:creator>TDD: Asserting on test dependency code at Mark Needham</dc:creator>
		<pubDate>Wed, 19 Aug 2009 13:23:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=755#comment-21557</guid>
		<description>[...] Ensure that all the setup for the test is done inside the test and not in setup methods. [...]</description>
		<content:encoded><![CDATA[<p>[...] Ensure that all the setup for the test is done inside the test and not in setup methods. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://www.markhneedham.com/blog/2008/12/19/tdd-mock-expectations-in-setup/comment-page-1/#comment-2144</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Fri, 19 Dec 2008 18:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=755#comment-2144</guid>
		<description>In general I don&#039;t need it. I use a mock framework that allows to verify the interaction after exercising the SUT. In those cases there&#039;s no Expect to use on the setup.

The only case left is when we Stub something. In those cases it is unlikely to get lucky and be able to DRY it into the setup. Usually when I Stub something it implies different values for different tests so I don&#039;t get to refactor it into the Setup.

So, yes I follow DRY all the time. 

In this case ExpectServiceToReturnSomeValue is a Stub ... I&#039;m calling it nowadays
GivenServiceWillReturnSomeValue() ... and i&#039;d move it into the setup if its necessary for Every test methods.</description>
		<content:encoded><![CDATA[<p>In general I don&#8217;t need it. I use a mock framework that allows to verify the interaction after exercising the SUT. In those cases there&#8217;s no Expect to use on the setup.</p>
<p>The only case left is when we Stub something. In those cases it is unlikely to get lucky and be able to DRY it into the setup. Usually when I Stub something it implies different values for different tests so I don&#8217;t get to refactor it into the Setup.</p>
<p>So, yes I follow DRY all the time. </p>
<p>In this case ExpectServiceToReturnSomeValue is a Stub &#8230; I&#8217;m calling it nowadays<br />
GivenServiceWillReturnSomeValue() &#8230; and i&#8217;d move it into the setup if its necessary for Every test methods.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

