<?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: Encapsulating Test Data and Expectations</title>
	<atom:link href="http://lostechies.com/johnteague/2008/08/13/encapsulating-test-data-and-expectations/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/johnteague/2008/08/13/encapsulating-test-data-and-expectations/</link>
	<description></description>
	<lastBuildDate>Wed, 08 May 2013 18:43: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: jcteague</title>
		<link>http://lostechies.com/johnteague/2008/08/13/encapsulating-test-data-and-expectations/#comment-27</link>
		<dc:creator>jcteague</dc:creator>
		<pubDate>Tue, 09 Sep 2008 13:02:41 +0000</pubDate>
		<guid isPermaLink="false">/blogs/johnteague/archive/2008/08/12/encapsulating-test-data-and-expectations.aspx#comment-27</guid>
		<description>@Aaron
Yes, I read that a long time ago.  Your approach is definitely one of the more elegant approaches to fluent builders out there.  Like I said in the post and my comment to Colin, for complicated objects fluent builder are great.  But if you have simple object and you don&#039;t want a bunch of one-off static methods, this approach is useful</description>
		<content:encoded><![CDATA[<p>@Aaron<br />
Yes, I read that a long time ago.  Your approach is definitely one of the more elegant approaches to fluent builders out there.  Like I said in the post and my comment to Colin, for complicated objects fluent builder are great.  But if you have simple object and you don&#8217;t want a bunch of one-off static methods, this approach is useful</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Jensen</title>
		<link>http://lostechies.com/johnteague/2008/08/13/encapsulating-test-data-and-expectations/#comment-26</link>
		<dc:creator>Aaron Jensen</dc:creator>
		<pubDate>Tue, 09 Sep 2008 12:48:37 +0000</pubDate>
		<guid isPermaLink="false">/blogs/johnteague/archive/2008/08/12/encapsulating-test-data-and-expectations.aspx#comment-26</guid>
		<description>Have you seen this?
http://blog.eleutian.com/2007/09/29/FluentFixtures.aspx
</description>
		<content:encoded><![CDATA[<p>Have you seen this?<br />
<a href="http://blog.eleutian.com/2007/09/29/FluentFixtures.aspx" rel="nofollow">http://blog.eleutian.com/2007/09/29/FluentFixtures.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jcteague</title>
		<link>http://lostechies.com/johnteague/2008/08/13/encapsulating-test-data-and-expectations/#comment-25</link>
		<dc:creator>jcteague</dc:creator>
		<pubDate>Wed, 13 Aug 2008 22:39:29 +0000</pubDate>
		<guid isPermaLink="false">/blogs/johnteague/archive/2008/08/12/encapsulating-test-data-and-expectations.aspx#comment-25</guid>
		<description>@Colin
Nice Post.  One of problems I ran into quickly was the number of factory methods I needed with Object Mother pattern, so I wanted a way to set specific values in one place and keep the number down.  The delegate lets me set whatever values I want without an explosion of factory methods and overloads. 

If I was using a lot of the fields in my object (mapping from DTO&#039;s as an example) and I set the values in question after the OM created the object, I would be in the same situation I was trying to avoid.

</description>
		<content:encoded><![CDATA[<p>@Colin<br />
Nice Post.  One of problems I ran into quickly was the number of factory methods I needed with Object Mother pattern, so I wanted a way to set specific values in one place and keep the number down.  The delegate lets me set whatever values I want without an explosion of factory methods and overloads. </p>
<p>If I was using a lot of the fields in my object (mapping from DTO&#8217;s as an example) and I set the values in question after the OM created the object, I would be in the same situation I was trying to avoid.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Jack</title>
		<link>http://lostechies.com/johnteague/2008/08/13/encapsulating-test-data-and-expectations/#comment-24</link>
		<dc:creator>Colin Jack</dc:creator>
		<pubDate>Wed, 13 Aug 2008 10:03:58 +0000</pubDate>
		<guid isPermaLink="false">/blogs/johnteague/archive/2008/08/12/encapsulating-test-data-and-expectations.aspx#comment-24</guid>
		<description>Agree about dislike of approach in &quot;should_sum_all_line_item_prices_times_quantity&quot;, I prefer one of the approaches described here (http://xunitpatterns.com/Creation%20Method.html). In particular when calling an OBJECT MOTHER if something isn&#039;t clear from the method name and isn&#039;t passed in then I don&#039;t think your tests should rely on it because if they do then they get fragile and confusing.

Haven&#039;t tried the solution you describe but did you consider just getting the OM to create an object and then changing any values that are important in the test? So in &quot;should_sum_all_line_item_prices_times_quantity&quot; you&#039;d use OM to create an empty sales order (if that is allowed) and then you&#039;d add the line items in the test (line items presumably being VALUE OBJECTS and thus suiting a builder). Does delegates add something over that approach.

Anyway so far my approach has been to use TEST DATA BUILDER for value objects and then OBJECT MOTHER for Entities. However in a few cases I&#039;ve added a BUILDER style fluent interface on top of the OBJECT MOTHER for an entity, for example this fluent interface gives me an easy way to say &quot;Give me a customer with a relationship to an account manager who works for the company Spondooliks&quot;. Gotta finish a blog entry about the approach I&#039;ve used as I&#039;m interested in knowing why its total rubbish :)

Note: I capitilized pattern names to try and make it clear what I mean.</description>
		<content:encoded><![CDATA[<p>Agree about dislike of approach in &#8220;should_sum_all_line_item_prices_times_quantity&#8221;, I prefer one of the approaches described here (<a href="http://xunitpatterns.com/Creation%20Method.html" rel="nofollow">http://xunitpatterns.com/Creation%20Method.html</a>). In particular when calling an OBJECT MOTHER if something isn&#8217;t clear from the method name and isn&#8217;t passed in then I don&#8217;t think your tests should rely on it because if they do then they get fragile and confusing.</p>
<p>Haven&#8217;t tried the solution you describe but did you consider just getting the OM to create an object and then changing any values that are important in the test? So in &#8220;should_sum_all_line_item_prices_times_quantity&#8221; you&#8217;d use OM to create an empty sales order (if that is allowed) and then you&#8217;d add the line items in the test (line items presumably being VALUE OBJECTS and thus suiting a builder). Does delegates add something over that approach.</p>
<p>Anyway so far my approach has been to use TEST DATA BUILDER for value objects and then OBJECT MOTHER for Entities. However in a few cases I&#8217;ve added a BUILDER style fluent interface on top of the OBJECT MOTHER for an entity, for example this fluent interface gives me an easy way to say &#8220;Give me a customer with a relationship to an account manager who works for the company Spondooliks&#8221;. Gotta finish a blog entry about the approach I&#8217;ve used as I&#8217;m interested in knowing why its total rubbish <img src='http://lostechies.com/johnteague/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Note: I capitilized pattern names to try and make it clear what I mean.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
