<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>ShouldBeAbleTo</title>
	<atom:link href="http://shouldbeableto.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://shouldbeableto.wordpress.com</link>
	<description>C# &#38; .NET</description>
	<lastBuildDate>Sun, 14 Jun 2009 20:55:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='shouldbeableto.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>ShouldBeAbleTo</title>
		<link>http://shouldbeableto.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://shouldbeableto.wordpress.com/osd.xml" title="ShouldBeAbleTo" />
	<atom:link rel='hub' href='http://shouldbeableto.wordpress.com/?pushpress=hub'/>
		<item>
		<title>NBuilder website launched</title>
		<link>http://shouldbeableto.wordpress.com/2009/06/14/nbuilder-website-launched/</link>
		<comments>http://shouldbeableto.wordpress.com/2009/06/14/nbuilder-website-launched/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 20:55:20 +0000</pubDate>
		<dc:creator>garethdown44</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://shouldbeableto.wordpress.com/?p=75</guid>
		<description><![CDATA[I&#8217;ve created a website for NBuilder. I&#8217;ve created some documentation for the main features which I&#8217;ll be adding to over the coming weeks. Please check it out &#8211; http://nbuilder.org<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shouldbeableto.wordpress.com&amp;blog=6402106&amp;post=75&amp;subd=shouldbeableto&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve created a <a title="NBuilder website" href="http://nbuilder.org" target="_blank">website for NBuilder</a>.</p>
<p>I&#8217;ve created some <a href="http://nbuilder.org/Documentation">documentation</a> for the main features which I&#8217;ll be adding to over the coming weeks.</p>
<p>Please check it out &#8211; <a title="NBuilder website" href="http://nbuilder.org" target="_blank">http://nbuilder.org</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shouldbeableto.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shouldbeableto.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shouldbeableto.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shouldbeableto.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shouldbeableto.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shouldbeableto.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shouldbeableto.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shouldbeableto.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shouldbeableto.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shouldbeableto.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shouldbeableto.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shouldbeableto.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shouldbeableto.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shouldbeableto.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shouldbeableto.wordpress.com&amp;blog=6402106&amp;post=75&amp;subd=shouldbeableto&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shouldbeableto.wordpress.com/2009/06/14/nbuilder-website-launched/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3abc97574d88588b28c1468180636ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gareth44</media:title>
		</media:content>
	</item>
		<item>
		<title>Fluent Dates added to NBuilder</title>
		<link>http://shouldbeableto.wordpress.com/2009/06/06/fluent-dates-added-to-nbuilder/</link>
		<comments>http://shouldbeableto.wordpress.com/2009/06/06/fluent-dates-added-to-nbuilder/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 11:32:45 +0000</pubDate>
		<dc:creator>garethdown44</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://shouldbeableto.wordpress.com/?p=61</guid>
		<description><![CDATA[I&#8217;ve just published a new release of NBuilder with fluent date support. This means you can specify dates in a nice readable syntax. The Problem Say you want to set a date, 21:15 on March 21st 2008 You&#8217;d most likely do it something like this: var date = new DateTime(2009, 03, 21, 21, 15); This [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shouldbeableto.wordpress.com&amp;blog=6402106&amp;post=61&amp;subd=shouldbeableto&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just published a new release of NBuilder with fluent date support. This means you can specify dates in a nice readable syntax.</p>
<h2>The Problem</h2>
<p>Say you want to set a date, 21:15 on March 21st 2008</p>
<p>You&#8217;d most likely do it something like this:</p>
<pre>var date = new DateTime(2009, 03, 21, 21, 15);</pre>
<p>This doesn&#8217;t read particularly well especially if you have loads of different dates.</p>
<h2>The Solution</h2>
<p>NBuilder&#8217;s fluent dates:</p>
<pre>var date = The.Year(2008).On.March.The21st.At(21, 15);</pre>
<p>That is the full syntax, there are loads of different variations, for convenience and better readability within different contexts.</p>
<h3>No year (defaults to current year):</h3>
<pre>product.Created = On.March.The21st.At(09, 15);</pre>
<h3>No time:</h3>
<pre>product.LastEdited = On.March.The21st;</pre>
<h3>Using The(x) instead:</h3>
<pre>product.Created = On.March.The(15)</pre>
<h3>Using static months instead:</h3>
<p>Just having the month without On. might read better in certain situations</p>
<pre>myEntity.LastEditedOn = December.The10th</pre>
<h3>Specifying a time:</h3>
<pre>TimeSpan time = At.Time(23, 15);</pre>
<p>or</p>
<pre>TimeSpan time = The.Time(23, 15);</pre>
<h3>Today at 2pm:</h3>
<pre>var date = Today.At(14, 00);</pre>
<h3>You can use seconds as well:</h3>
<pre>var dateTime = July.The4th.At(07, 00, 05);</pre>
<h2>Using in the context of NBuilder</h2>
<p>You can use the dates anywhere but in the context of NBuilder it would be something like this:</p>
<p><img class="alignnone size-full wp-image-65" title="Fluent dates and NBuilder" src="http://shouldbeableto.files.wordpress.com/2009/06/fluent_dates.jpg?w=544" alt="Fluent dates and NBuilder"   /></p>
<p>Of course you can use the fluent dates with the RandomGenerator too:</p>
<p><img class="alignnone size-full wp-image-66" title="random_fluent_dates" src="http://shouldbeableto.files.wordpress.com/2009/06/random_fluent_dates.jpg?w=544" alt="random_fluent_dates"   /></p>
<p>Hope you find it useful. Any comments / suggestions, please let me know.</p>
<h2>Download NBuilder 2.1.7</h2>
<p><a href="http://code.google.com/p/nbuilder/downloads/list">Download NBuilder 2.1.7 from google code</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shouldbeableto.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shouldbeableto.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shouldbeableto.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shouldbeableto.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shouldbeableto.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shouldbeableto.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shouldbeableto.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shouldbeableto.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shouldbeableto.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shouldbeableto.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shouldbeableto.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shouldbeableto.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shouldbeableto.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shouldbeableto.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shouldbeableto.wordpress.com&amp;blog=6402106&amp;post=61&amp;subd=shouldbeableto&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shouldbeableto.wordpress.com/2009/06/06/fluent-dates-added-to-nbuilder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3abc97574d88588b28c1468180636ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gareth44</media:title>
		</media:content>

		<media:content url="http://shouldbeableto.files.wordpress.com/2009/06/fluent_dates.jpg" medium="image">
			<media:title type="html">Fluent dates and NBuilder</media:title>
		</media:content>

		<media:content url="http://shouldbeableto.files.wordpress.com/2009/06/random_fluent_dates.jpg" medium="image">
			<media:title type="html">random_fluent_dates</media:title>
		</media:content>
	</item>
		<item>
		<title>NBuilder 2.1 Available</title>
		<link>http://shouldbeableto.wordpress.com/2009/04/19/nbuilder-21-available/</link>
		<comments>http://shouldbeableto.wordpress.com/2009/04/19/nbuilder-21-available/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 12:56:52 +0000</pubDate>
		<dc:creator>garethdown44</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Automated Testing]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Functional Testing]]></category>
		<category><![CDATA[NBuilder]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://shouldbeableto.wordpress.com/?p=54</guid>
		<description><![CDATA[A new version of NBuilder is available. This is a complete re-write of the original code but still has the same fluent interface with only a few slight differences. The code base is now very robust and there are loads of new features, including hierarchy generation and persistence support. Download the source and the binary [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shouldbeableto.wordpress.com&amp;blog=6402106&amp;post=54&amp;subd=shouldbeableto&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A new version of NBuilder is available.</p>
<p>This is a complete re-write of the original code but still has the same fluent interface with only a few slight differences.</p>
<p>The code base is now very robust and there are loads of new features, including hierarchy generation and persistence support.</p>
<p>Download the source and the binary from the <a href="http://code.google.com/p/nbuilder">NBuilder google code page</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shouldbeableto.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shouldbeableto.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shouldbeableto.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shouldbeableto.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shouldbeableto.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shouldbeableto.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shouldbeableto.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shouldbeableto.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shouldbeableto.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shouldbeableto.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shouldbeableto.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shouldbeableto.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shouldbeableto.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shouldbeableto.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shouldbeableto.wordpress.com&amp;blog=6402106&amp;post=54&amp;subd=shouldbeableto&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shouldbeableto.wordpress.com/2009/04/19/nbuilder-21-available/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3abc97574d88588b28c1468180636ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gareth44</media:title>
		</media:content>
	</item>
		<item>
		<title>NBuilder update coming shortly&#8230;</title>
		<link>http://shouldbeableto.wordpress.com/2009/03/26/nbuilder-update-coming-shortly/</link>
		<comments>http://shouldbeableto.wordpress.com/2009/03/26/nbuilder-update-coming-shortly/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 20:35:26 +0000</pubDate>
		<dc:creator>garethdown44</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://shouldbeableto.wordpress.com/?p=51</guid>
		<description><![CDATA[My contract at De Beers is coming to an end on the 3 April and I&#8217;ve been working incredibly long hours finishing off my final project so I haven&#8217;t had any time to work on NBuilder. I do have some really big changes coming soon which will really improve it a great deal and turn [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shouldbeableto.wordpress.com&amp;blog=6402106&amp;post=51&amp;subd=shouldbeableto&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My contract at De Beers is coming to an end on the 3 April and I&#8217;ve been working incredibly long hours finishing off my final project so I haven&#8217;t had any time to work on NBuilder. I do have some really big changes coming soon which will really improve it a great deal and turn it into something robust which can be used on real projects.</p>
<p>After almost a year at De Beers, I&#8217;ve decided to have a bit of time off to work on my own stuff.  I&#8217;m not sure if this is a good idea given the &#8216;current climate&#8217; but we&#8217;ll see!</p>
<p>I&#8217;ll probably have a month or two off, NBuilder is top of my list of things to do as I really think it has a lot of potential. Then I plan to learn as much as I can about automated acceptance testing.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shouldbeableto.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shouldbeableto.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shouldbeableto.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shouldbeableto.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shouldbeableto.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shouldbeableto.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shouldbeableto.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shouldbeableto.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shouldbeableto.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shouldbeableto.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shouldbeableto.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shouldbeableto.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shouldbeableto.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shouldbeableto.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shouldbeableto.wordpress.com&amp;blog=6402106&amp;post=51&amp;subd=shouldbeableto&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shouldbeableto.wordpress.com/2009/03/26/nbuilder-update-coming-shortly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3abc97574d88588b28c1468180636ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gareth44</media:title>
		</media:content>
	</item>
		<item>
		<title>NBuilder source code available</title>
		<link>http://shouldbeableto.wordpress.com/2009/03/02/nbuilder-source-code-available/</link>
		<comments>http://shouldbeableto.wordpress.com/2009/03/02/nbuilder-source-code-available/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 22:29:24 +0000</pubDate>
		<dc:creator>garethdown44</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://shouldbeableto.wordpress.com/?p=44</guid>
		<description><![CDATA[I have posted the source for NBuilder on google code. http://code.google.com/p/nbuilder/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shouldbeableto.wordpress.com&amp;blog=6402106&amp;post=44&amp;subd=shouldbeableto&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have posted the source for NBuilder on google code.</p>
<p><a href="http://code.google.com/p/nbuilder/" target="_self">http://code.google.com/p/nbuilder/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shouldbeableto.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shouldbeableto.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shouldbeableto.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shouldbeableto.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shouldbeableto.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shouldbeableto.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shouldbeableto.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shouldbeableto.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shouldbeableto.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shouldbeableto.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shouldbeableto.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shouldbeableto.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shouldbeableto.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shouldbeableto.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shouldbeableto.wordpress.com&amp;blog=6402106&amp;post=44&amp;subd=shouldbeableto&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shouldbeableto.wordpress.com/2009/03/02/nbuilder-source-code-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3abc97574d88588b28c1468180636ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gareth44</media:title>
		</media:content>
	</item>
		<item>
		<title>Introducing NBuilder</title>
		<link>http://shouldbeableto.wordpress.com/2009/02/01/3/</link>
		<comments>http://shouldbeableto.wordpress.com/2009/02/01/3/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 02:08:27 +0000</pubDate>
		<dc:creator>garethdown44</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Automated Testing]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Functional Testing]]></category>
		<category><![CDATA[NBuilder]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://shouldbeableto.wordpress.com/?p=3</guid>
		<description><![CDATA[NBuilder allows you to create test objects using a fluent interface. You can use the objects as return values from mocks, or to populate a database for use in automated integration/functional testing or acceptance testing.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shouldbeableto.wordpress.com&amp;blog=6402106&amp;post=3&amp;subd=shouldbeableto&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE</strong>: 06 June 2009 &#8211; This post is based on a proof of concept and as such the syntax has changed slightly. Please see the <a href="http://code.google.com/p/nbuilder/downloads/list">project page</a> for up to date documentation:</p>
<p>When I&#8217;m writing tests I frequently need to create some quick test data either              for using as the result of a mock object or perhaps for inserting into a              database and then either running an automated functional test or an automated              browser / acceptance test with it. I want to be able to create it in my test or              in the setup for a test and I want to be able to do it very quickly.</p>
<h2>The goal</h2>
<p>I want to be able to say something like this:</p>
<p><em>1. Create a list of 100 categories</em></p>
<p><em>2. Create a list of 100 products, and give them all between 1 and 5 categories each.</em></p>
<h2>Implementation<em><br />
</em></h2>
<p>Consider the following simple model:</p>
<p><img class="alignnone size-full wp-image-27" title="class_diagram1" src="http://shouldbeableto.files.wordpress.com/2009/02/class_diagram1.gif?w=544" alt="class_diagram1"   /></p>
<p>What I usually find myself doing is having a class such as ProductBuilder and              giving it static methods such as:</p>
<p><img class="alignnone size-full wp-image-6" title="fig01-product_builder" src="http://shouldbeableto.files.wordpress.com/2009/02/fig01-product_builder.gif?w=544" alt="fig01-product_builder"   /></p>
<p>Perhaps also with a few &#8216;<span style="color:#333333;">WithAbc</span>(xyz)&#8217; methods to set certain properties. However as              you can imagine you soon end up with loads of builder classes and loads of              methods.</p>
<p>I decided there had to be a better way. I had a quick search on the web but I              couldn&#8217;t find anything that looked like it would do the job. I wanted something              with a very fluent interface where I could almost write the code by saying              something like <em>Create 100 Products, each with a tax type of VAT, and each in              some categories</em>. I couldn&#8217;t find anything like this, so I decided to create a              library myself.</p>
<h2>Builder&lt;T&gt;</h2>
<p>I started off with a class <span class="type">Builder</span>&lt;T&gt;Then I          started by coming up with a generic way to create a list:</p>
<pre><img class="size-full wp-image-7" title="fig02" src="http://shouldbeableto.files.wordpress.com/2009/02/fig02.gif?w=544" alt="fig02"   /></pre>
<p>I thought that the properties should be set to something by default using some          reflection and decided I wasn&#8217;t really too bothered about what the values of          most of the properties were so i decided to to set every <strong>string</strong> to its          name, and append its one-based <strong>index</strong> to it. So for example the first object&#8217;s Title          would be set to <strong>Title1</strong>, the second <strong>Title2 </strong>etc, etc. All the integers and          decimals etc would be set to 1,2,3,4; 1.0, 2.0, 3.0, 4.0 etc, etc. So using this          you can easily make a list of products each with their basic properties          populated.</p>
<p>However, what if you want some of them &#8211; the first 10 to have a different title?          I added this where syntax to cope with that:</p>
<pre><img class="alignnone size-full wp-image-8" title="fig03" src="http://shouldbeableto.files.wordpress.com/2009/02/fig03.gif?w=544" alt="fig03"   /></pre>
<p>Ok cool &#8211; but what if you also want those same ten to have a specific value for          the QuantityInStock property:</p>
<pre><img class="alignnone size-full wp-image-9" title="fig04" src="http://shouldbeableto.files.wordpress.com/2009/02/fig04.gif?w=544" alt="fig04"   /></pre>
<p>How about you want to give them a random quantity, between 1 and 2000? This is where the Generate class comes in:</p>
<pre><img class="alignnone size-full wp-image-10" title="fig05" src="http://shouldbeableto.files.wordpress.com/2009/02/fig05.gif?w=544" alt="fig05"   /></pre>
<p>How about if you want the next ten after it to have different properties still:</p>
<pre><img class="alignnone size-full wp-image-11" title="fig06" src="http://shouldbeableto.files.wordpress.com/2009/02/fig06.gif?w=544" alt="fig06"   /></pre>
<p>What about giving a random 50 the quantity of 1? (Perhaps you could test some stock alerting functionality with this for instance)</p>
<pre><img class="alignnone size-full wp-image-12" title="fig07" src="http://shouldbeableto.files.wordpress.com/2009/02/fig07.gif?w=544" alt="fig07"   /></pre>
<h2>The &#8216;Pick&#8217; Class</h2>
<p>Ok you get the idea. That’s the easy kind of thing out of the way. How about relations? What if you want to add categories to your products? What if you want to add different categories and a different number of categories to each product?</p>
<p>I came up with the ‘Pick’ class to do this.</p>
<pre><img class="alignnone size-full wp-image-13" title="fig08" src="http://shouldbeableto.files.wordpress.com/2009/02/fig08.gif?w=544" alt="fig08"   /></pre>
<p>I think that reads pretty well, if I was coming to read someone’s test set up, I could see straight away from that what they were doing.</p>
<p>Now do what you want with them – return them in a mocked object or if you&#8217;re doing a functional/integration or acceptance test you could use your repository / data layer to save them to the database:</p>
<pre><img class="alignnone size-full wp-image-16" title="fig08_1" src="http://shouldbeableto.files.wordpress.com/2009/02/fig08_1.gif?w=544" alt="fig08_1"   /></pre>
<p>Test data inserted and it only took a few lines of simple easy to read code. Job done, now you can get on and write your tests.</p>
<h2>Adding NBuilder to your functional test</h2>
<pre><img class="alignnone size-full wp-image-33" title="fig093" src="http://shouldbeableto.files.wordpress.com/2009/02/fig093.gif?w=544" alt="fig093"   /></pre>
<h2>Download the binary</h2>
<p><a title="Download NBuilder Binary" href="http://code.google.com/p/nbuilder/downloads/list">Download NBuilder Binary from Google Code<br />
</a></p>
<h2>Features I haven&#8217;t mentioned here</h2>
<ol>
<li>The method <strong><em>HaveDoneToThem(Action&lt;T&gt;)</em></strong>. As the name suggests this allows you to call a method on each object in the same way as you use <strong><em>Have()</em></strong>. You could use this to add a value object to each of the list elements.</li>
<li>There is also a CreateNew() method for creating a single object.</li>
</ol>
<h2>Please bear in mind&#8230;</h2>
<p>Please note that this is only one step up from a proof of concept at the moment so if you try it out please bear in mind:</p>
<ol>
<li> While it has been unit tested, and everything I have described here does work, it has only been tested using this syntax. For example I have no idea what would happen if you did a <strong>Have()</strong> before having done a <strong>WhereTheFirst()</strong> or <strong>WhereRandom().</strong> You might get an exception.</li>
<li> When the initial object generation happens, it supports most simple data types int, string, long, DateTime etc, but it doesn&#8217;t support unsigned types yet. (No particular reason other than I just haven&#8217;t bothered to add them in yet)</li>
<li> The Generate class only support ints and decimals. And it doesn&#8217;t support decimals all that well either! You can only say generate numbers between two integers at the moment.</li>
</ol>
<p>As I use this tool in real projects over the next few weeks I will add to it, make it more robust and do another posting and probably get the source code up very soon too.</p>
<h2>Comments and suggestions</h2>
<p>I&#8217;d be interested to hear any comments, suggestions or if anyone knows if there is already something out there that does what NBuilder does.</p>
<p>p.s. &#8211; Sorry &#8211; I couldn&#8217;t think of anything more imaginative than <em>NBuilder</em>!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shouldbeableto.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shouldbeableto.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shouldbeableto.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shouldbeableto.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shouldbeableto.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shouldbeableto.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shouldbeableto.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shouldbeableto.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shouldbeableto.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shouldbeableto.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shouldbeableto.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shouldbeableto.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shouldbeableto.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shouldbeableto.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shouldbeableto.wordpress.com&amp;blog=6402106&amp;post=3&amp;subd=shouldbeableto&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shouldbeableto.wordpress.com/2009/02/01/3/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a3abc97574d88588b28c1468180636ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gareth44</media:title>
		</media:content>

		<media:content url="http://shouldbeableto.files.wordpress.com/2009/02/class_diagram1.gif" medium="image">
			<media:title type="html">class_diagram1</media:title>
		</media:content>

		<media:content url="http://shouldbeableto.files.wordpress.com/2009/02/fig01-product_builder.gif" medium="image">
			<media:title type="html">fig01-product_builder</media:title>
		</media:content>

		<media:content url="http://shouldbeableto.files.wordpress.com/2009/02/fig02.gif" medium="image">
			<media:title type="html">fig02</media:title>
		</media:content>

		<media:content url="http://shouldbeableto.files.wordpress.com/2009/02/fig03.gif" medium="image">
			<media:title type="html">fig03</media:title>
		</media:content>

		<media:content url="http://shouldbeableto.files.wordpress.com/2009/02/fig04.gif" medium="image">
			<media:title type="html">fig04</media:title>
		</media:content>

		<media:content url="http://shouldbeableto.files.wordpress.com/2009/02/fig05.gif" medium="image">
			<media:title type="html">fig05</media:title>
		</media:content>

		<media:content url="http://shouldbeableto.files.wordpress.com/2009/02/fig06.gif" medium="image">
			<media:title type="html">fig06</media:title>
		</media:content>

		<media:content url="http://shouldbeableto.files.wordpress.com/2009/02/fig07.gif" medium="image">
			<media:title type="html">fig07</media:title>
		</media:content>

		<media:content url="http://shouldbeableto.files.wordpress.com/2009/02/fig08.gif" medium="image">
			<media:title type="html">fig08</media:title>
		</media:content>

		<media:content url="http://shouldbeableto.files.wordpress.com/2009/02/fig08_1.gif" medium="image">
			<media:title type="html">fig08_1</media:title>
		</media:content>

		<media:content url="http://shouldbeableto.files.wordpress.com/2009/02/fig093.gif" medium="image">
			<media:title type="html">fig093</media:title>
		</media:content>
	</item>
	</channel>
</rss>
