<?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: The Art of Unit Testing &#8211; Chapter 3</title>
	<atom:link href="http://dublinalt.net/2009/10/05/the-art-of-unit-testing-chapter-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://dublinalt.net/2009/10/05/the-art-of-unit-testing-chapter-3/</link>
	<description>The first ALT.NET group in Ireland</description>
	<lastBuildDate>Fri, 22 Jul 2011 14:24:08 +0000</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Billy Stack</title>
		<link>http://dublinalt.net/2009/10/05/the-art-of-unit-testing-chapter-3/comment-page-1/#comment-494</link>
		<dc:creator>Billy Stack</dc:creator>
		<pubDate>Mon, 22 Feb 2010 00:01:16 +0000</pubDate>
		<guid isPermaLink="false">http://dublinalt.net/?p=156#comment-494</guid>
		<description>Just read this chapter, I know ye read this book months ago but Il throw in my two pence worth anyway:

We use option 3 sometimes...

Option 3 i.e &quot;Getting a stub just before the method call&quot; is essentially &quot;setter&quot; injection in a factory.

We have different grades of dependency. Mandatory references will always be injected via ctor. Optional references will be usually &quot; setter&quot; injected - e.g. diagnostics. Also, an arguable advantage is of using this approach is the code is simple to read!

He briefly mentions that TOOD conflicts with OOD - from my experience thats a huge understatement. Usually, using IOC + SRP etc means code is easier to test - but this makes the code much more complex - e.g. at the high level of the domain you may sometimes end up with classes that have a ridiculous number of dependencies. 100% TOOD + 100% OOD != solved problem. In my opinion fully abiding by OOD means TOOD is broken or vice versa - you cant have the best of both worlds, you must instead trike a happy medium. In my experience finding the happy medium can be challenging!

Additional notes:
Wouldnt it be so much easier if c# had virtual methods by default!
Really like InternalsInvisibleTo, may adopt this</description>
		<content:encoded><![CDATA[<p>Just read this chapter, I know ye read this book months ago but Il throw in my two pence worth anyway:</p>
<p>We use option 3 sometimes&#8230;</p>
<p>Option 3 i.e &#8220;Getting a stub just before the method call&#8221; is essentially &#8220;setter&#8221; injection in a factory.</p>
<p>We have different grades of dependency. Mandatory references will always be injected via ctor. Optional references will be usually &#8221; setter&#8221; injected &#8211; e.g. diagnostics. Also, an arguable advantage is of using this approach is the code is simple to read!</p>
<p>He briefly mentions that TOOD conflicts with OOD &#8211; from my experience thats a huge understatement. Usually, using IOC + SRP etc means code is easier to test &#8211; but this makes the code much more complex &#8211; e.g. at the high level of the domain you may sometimes end up with classes that have a ridiculous number of dependencies. 100% TOOD + 100% OOD != solved problem. In my opinion fully abiding by OOD means TOOD is broken or vice versa &#8211; you cant have the best of both worlds, you must instead trike a happy medium. In my experience finding the happy medium can be challenging!</p>
<p>Additional notes:<br />
Wouldnt it be so much easier if c# had virtual methods by default!<br />
Really like InternalsInvisibleTo, may adopt this</p>
]]></content:encoded>
	</item>
</channel>
</rss>

