<?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: Be wary of container calls in tests</title>
	<atom:link href="http://lostechies.com/jimmybogard/2009/01/29/be-wary-of-container-calls-in-tests/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/jimmybogard/2009/01/29/be-wary-of-container-calls-in-tests/</link>
	<description>Strong opinions, weakly held</description>
	<lastBuildDate>Wed, 19 Jun 2013 17:39: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: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2009/01/29/be-wary-of-container-calls-in-tests/#comment-1271</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Thu, 05 Feb 2009 03:55:06 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/01/28/be-wary-of-container-calls-in-tests.aspx#comment-1271</guid>
		<description>@mendicant

For what tests is the container in play?</description>
		<content:encoded><![CDATA[<p>@mendicant</p>
<p>For what tests is the container in play?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mendicant</title>
		<link>http://lostechies.com/jimmybogard/2009/01/29/be-wary-of-container-calls-in-tests/#comment-1270</link>
		<dc:creator>mendicant</dc:creator>
		<pubDate>Wed, 04 Feb 2009 23:00:03 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/01/28/be-wary-of-container-calls-in-tests.aspx#comment-1270</guid>
		<description>Jimmy, 

We have seen those sorts of things blow up like that, but we are using the IOC configured exactly the way it would be in production (except for logging, which is changed to the console) so I guess for us when it blows up like that, we take it as time to fix something that really needed to be fixed anyway. It&#039;s usually a one time fix, and something that needed to be fixed not only for the integration test to run, but also for the app to run. I guess that makes it seem like less of a pain for us (and it really doesn&#039;t happen that often).
</description>
		<content:encoded><![CDATA[<p>Jimmy, </p>
<p>We have seen those sorts of things blow up like that, but we are using the IOC configured exactly the way it would be in production (except for logging, which is changed to the console) so I guess for us when it blows up like that, we take it as time to fix something that really needed to be fixed anyway. It&#8217;s usually a one time fix, and something that needed to be fixed not only for the integration test to run, but also for the app to run. I guess that makes it seem like less of a pain for us (and it really doesn&#8217;t happen that often).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Flanagan</title>
		<link>http://lostechies.com/jimmybogard/2009/01/29/be-wary-of-container-calls-in-tests/#comment-1269</link>
		<dc:creator>Joshua Flanagan</dc:creator>
		<pubDate>Wed, 04 Feb 2009 01:39:15 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/01/28/be-wary-of-container-calls-in-tests.aspx#comment-1269</guid>
		<description>I get the point about not using a container in tests - the main intention of your post. It was only the throwaway jab at automocking that I was curious about.

Anyway, explanation posted:
http://www.lostechies.com/blogs/joshuaflanagan/archive/2009/02/03/auto-mocking-explained.aspx
</description>
		<content:encoded><![CDATA[<p>I get the point about not using a container in tests &#8211; the main intention of your post. It was only the throwaway jab at automocking that I was curious about.</p>
<p>Anyway, explanation posted:<br />
<a href="http://www.lostechies.com/blogs/joshuaflanagan/archive/2009/02/03/auto-mocking-explained.aspx" rel="nofollow">http://www.lostechies.com/blogs/joshuaflanagan/archive/2009/02/03/auto-mocking-explained.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2009/01/29/be-wary-of-container-calls-in-tests/#comment-1268</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Tue, 03 Feb 2009 14:18:45 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/01/28/be-wary-of-container-calls-in-tests.aspx#comment-1268</guid>
		<description>@Josh

I&#039;m taking your Dovetail Kool-aid away from you.  For me, AMC is solving a problem I don&#039;t have.  I don&#039;t feel any pain manually creating mocks in tests, and I don&#039;t have to go through something else to go get a reference to them.  Show me (in a post hopefully) a side-by-side comparison of with/without AMC and tell me why I should care.

What I was referring to was not AMC but using a Container to get &quot;real&quot; dependencies.</description>
		<content:encoded><![CDATA[<p>@Josh</p>
<p>I&#8217;m taking your Dovetail Kool-aid away from you.  For me, AMC is solving a problem I don&#8217;t have.  I don&#8217;t feel any pain manually creating mocks in tests, and I don&#8217;t have to go through something else to go get a reference to them.  Show me (in a post hopefully) a side-by-side comparison of with/without AMC and tell me why I should care.</p>
<p>What I was referring to was not AMC but using a Container to get &#8220;real&#8221; dependencies.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Flanagan</title>
		<link>http://lostechies.com/jimmybogard/2009/01/29/be-wary-of-container-calls-in-tests/#comment-1267</link>
		<dc:creator>Joshua Flanagan</dc:creator>
		<pubDate>Tue, 03 Feb 2009 13:22:42 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/01/28/be-wary-of-container-calls-in-tests.aspx#comment-1267</guid>
		<description>With an auto-mocker, you also know exactly what is being constructed - your class under test. Any dependencies it has are mocks. There is no container configuration involved, and there shouldn&#039;t be any mystery.
Is there some other confusing aspect that I&#039;m not recognizing?</description>
		<content:encoded><![CDATA[<p>With an auto-mocker, you also know exactly what is being constructed &#8211; your class under test. Any dependencies it has are mocks. There is no container configuration involved, and there shouldn&#8217;t be any mystery.<br />
Is there some other confusing aspect that I&#8217;m not recognizing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2009/01/29/be-wary-of-container-calls-in-tests/#comment-1266</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Fri, 30 Jan 2009 00:13:41 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/01/28/be-wary-of-container-calls-in-tests.aspx#comment-1266</guid>
		<description>@mendicant

One problem we ran into was not that our container threw exceptions, but rather was not configured completely correctly for a test.  A failure occurred because the wrong piece was wired up.  We do have container tests, which caught it, but a whole bunch of tests that failed with a lot of noise.  Have you seen that?</description>
		<content:encoded><![CDATA[<p>@mendicant</p>
<p>One problem we ran into was not that our container threw exceptions, but rather was not configured completely correctly for a test.  A failure occurred because the wrong piece was wired up.  We do have container tests, which caught it, but a whole bunch of tests that failed with a lot of noise.  Have you seen that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2009/01/29/be-wary-of-container-calls-in-tests/#comment-1265</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Thu, 29 Jan 2009 22:51:11 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/01/28/be-wary-of-container-calls-in-tests.aspx#comment-1265</guid>
		<description>@James

Those are integration tests, but we still don&#039;t get a container involved.  Just a local creation method will work, passing the exact dependencies I want involved.</description>
		<content:encoded><![CDATA[<p>@James</p>
<p>Those are integration tests, but we still don&#8217;t get a container involved.  Just a local creation method will work, passing the exact dependencies I want involved.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mendicant</title>
		<link>http://lostechies.com/jimmybogard/2009/01/29/be-wary-of-container-calls-in-tests/#comment-1264</link>
		<dc:creator>mendicant</dc:creator>
		<pubDate>Thu, 29 Jan 2009 21:41:41 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/01/28/be-wary-of-container-calls-in-tests.aspx#comment-1264</guid>
		<description>We use the IOC quite a bit in our integration tests. We have wrappers around Windsor that causes it to log out any errors it has when building an object.

As of yet, we haven&#039;t had big problems with the IOC, at least none that weren&#039;t explicitly catching issues that couldn&#039;t be caught by just wiring up the container. For example, someone forgot to set up serviceoverrides, so we weren&#039;t getting the right implementation and tests were blowing up trying to use incorrect implementations.

However, on the other hand, we had to spend a lot of time making sure that our integration tests painstakingly remove any data that they may put into the database, so that a failure in one integration test doesn&#039;t cascade down into other ones using the same tables.

Really, the biggest downfall is the infrastructure we&#039;ve had to wrap our tests in to make sure that they&#039;re atomic in terms of the DB. It can (not always, but sometimes) make things a little bit annoying when writing a new integration test.</description>
		<content:encoded><![CDATA[<p>We use the IOC quite a bit in our integration tests. We have wrappers around Windsor that causes it to log out any errors it has when building an object.</p>
<p>As of yet, we haven&#8217;t had big problems with the IOC, at least none that weren&#8217;t explicitly catching issues that couldn&#8217;t be caught by just wiring up the container. For example, someone forgot to set up serviceoverrides, so we weren&#8217;t getting the right implementation and tests were blowing up trying to use incorrect implementations.</p>
<p>However, on the other hand, we had to spend a lot of time making sure that our integration tests painstakingly remove any data that they may put into the database, so that a failure in one integration test doesn&#8217;t cascade down into other ones using the same tables.</p>
<p>Really, the biggest downfall is the infrastructure we&#8217;ve had to wrap our tests in to make sure that they&#8217;re atomic in terms of the DB. It can (not always, but sometimes) make things a little bit annoying when writing a new integration test.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://lostechies.com/jimmybogard/2009/01/29/be-wary-of-container-calls-in-tests/#comment-1263</link>
		<dc:creator>James</dc:creator>
		<pubDate>Thu, 29 Jan 2009 20:50:40 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/01/28/be-wary-of-container-calls-in-tests.aspx#comment-1263</guid>
		<description>How do you test multiple implementations of your repositories (or any interface that has multiple implementations) without duplicating your tests across multiple projects?

For instance, say you have a SqlUserRepository and an ActiveDirectoryUserRepository ?</description>
		<content:encoded><![CDATA[<p>How do you test multiple implementations of your repositories (or any interface that has multiple implementations) without duplicating your tests across multiple projects?</p>
<p>For instance, say you have a SqlUserRepository and an ActiveDirectoryUserRepository ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2009/01/29/be-wary-of-container-calls-in-tests/#comment-1262</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Thu, 29 Jan 2009 19:07:44 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/01/28/be-wary-of-container-calls-in-tests.aspx#comment-1262</guid>
		<description>@Travis

At that point, you&#039;re really only looking at an interaction test.  Each of the other pieces are abstractions, so there&#039;s no real point in getting them all up and going.

With test doubles, you can force your code down whatever path you like, without needing to set up your repository with the right data in the database, etc etc. This is assuming you&#039;ve placed all your services behind interfaces, that is.</description>
		<content:encoded><![CDATA[<p>@Travis</p>
<p>At that point, you&#8217;re really only looking at an interaction test.  Each of the other pieces are abstractions, so there&#8217;s no real point in getting them all up and going.</p>
<p>With test doubles, you can force your code down whatever path you like, without needing to set up your repository with the right data in the database, etc etc. This is assuming you&#8217;ve placed all your services behind interfaces, that is.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
