<?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: Changing how I structure unit tests</title>
	<atom:link href="http://jonkruger.com/blog/2012/01/18/changing-how-i-structure-unit-tests/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonkruger.com/blog/2012/01/18/changing-how-i-structure-unit-tests/</link>
	<description></description>
	<pubDate>Fri, 18 May 2012 01:46:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jon Kruger</title>
		<link>http://jonkruger.com/blog/2012/01/18/changing-how-i-structure-unit-tests/comment-page-1/#comment-5623</link>
		<dc:creator>Jon Kruger</dc:creator>
		<pubDate>Mon, 30 Jan 2012 00:59:47 +0000</pubDate>
		<guid isPermaLink="false">http://jonkruger.com/blog/?p=1020#comment-5623</guid>
		<description>Tim,

The thing is that now that before_each is split up into multiple Given methods, so it's not as messy.  Sometimes those Given methods are still a little messy, and sometimes I still need a "before_each" style setup method that sets up mocks and stubs that apply to all of the tests.  But at least it's readable now.</description>
		<content:encoded><![CDATA[<p>Tim,</p>
<p>The thing is that now that before_each is split up into multiple Given methods, so it&#8217;s not as messy.  Sometimes those Given methods are still a little messy, and sometimes I still need a &#8220;before_each&#8221; style setup method that sets up mocks and stubs that apply to all of the tests.  But at least it&#8217;s readable now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://jonkruger.com/blog/2012/01/18/changing-how-i-structure-unit-tests/comment-page-1/#comment-5622</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Sun, 29 Jan 2012 22:07:01 +0000</pubDate>
		<guid isPermaLink="false">http://jonkruger.com/blog/?p=1020#comment-5622</guid>
		<description>Interesting. A question...

Large set-up of dependencies always make my "before_each" (your "establish_context" above) type methods pretty large, so I'm guessing that happens in your Given method. Is that the case in practice? Or do you build the context elsewhere to keep the Given clean?</description>
		<content:encoded><![CDATA[<p>Interesting. A question&#8230;</p>
<p>Large set-up of dependencies always make my &#8220;before_each&#8221; (your &#8220;establish_context&#8221; above) type methods pretty large, so I&#8217;m guessing that happens in your Given method. Is that the case in practice? Or do you build the context elsewhere to keep the Given clean?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://jonkruger.com/blog/2012/01/18/changing-how-i-structure-unit-tests/comment-page-1/#comment-5621</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Sun, 29 Jan 2012 13:04:45 +0000</pubDate>
		<guid isPermaLink="false">http://jonkruger.com/blog/?p=1020#comment-5621</guid>
		<description>Thanks for posting this Jon. I have noticed a lot of discussion on StackOverflow about how to structure unit tests in a BDD style, and have seen tools such as NBehave and MSpec promoted. The problem is, it requires a developer to really think about what the test code is doing, not what the semantics of the test actually are. 

That being said, I have favored using Gherkin to drive the unit testing layer and have used SpecFlow to implement my Specs. However, I am going to have to try the approach you are sharing here. It is elegantly simplistic, and quickly helps developers to know exactly how a unit of code should behave and potentially allows us to share this more easily with non-technical people. 

At the end of the day, I truly think that unit tests, behavior tests, and acceptance tests should be written so anyone (technical or not) could pick up a test and understand what is being tested. 

Thanks again!</description>
		<content:encoded><![CDATA[<p>Thanks for posting this Jon. I have noticed a lot of discussion on StackOverflow about how to structure unit tests in a BDD style, and have seen tools such as NBehave and MSpec promoted. The problem is, it requires a developer to really think about what the test code is doing, not what the semantics of the test actually are. </p>
<p>That being said, I have favored using Gherkin to drive the unit testing layer and have used SpecFlow to implement my Specs. However, I am going to have to try the approach you are sharing here. It is elegantly simplistic, and quickly helps developers to know exactly how a unit of code should behave and potentially allows us to share this more easily with non-technical people. </p>
<p>At the end of the day, I truly think that unit tests, behavior tests, and acceptance tests should be written so anyone (technical or not) could pick up a test and understand what is being tested. </p>
<p>Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik</title>
		<link>http://jonkruger.com/blog/2012/01/18/changing-how-i-structure-unit-tests/comment-page-1/#comment-5613</link>
		<dc:creator>Erik</dc:creator>
		<pubDate>Wed, 18 Jan 2012 21:44:17 +0000</pubDate>
		<guid isPermaLink="false">http://jonkruger.com/blog/?p=1020#comment-5613</guid>
		<description>I've never seen tests structured like that before, and it's interesting.  I'm wondering if you could set up a fluent interface paradigm where all of the helpers return an instance of the class under test.  (I haven't really thought through the details, but the possibility of having Assert(Given().When().Then()) seems interesting)</description>
		<content:encoded><![CDATA[<p>I&#8217;ve never seen tests structured like that before, and it&#8217;s interesting.  I&#8217;m wondering if you could set up a fluent interface paradigm where all of the helpers return an instance of the class under test.  (I haven&#8217;t really thought through the details, but the possibility of having Assert(Given().When().Then()) seems interesting)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

