<?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: Easily Unit Testing Event Handlers</title>
	<atom:link href="http://www.philosophicalgeek.com/2007/12/27/easily-unit-testing-event-handlers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.philosophicalgeek.com/2007/12/27/easily-unit-testing-event-handlers/</link>
	<description>Code and musings by Ben Watson</description>
	<lastBuildDate>Sat, 04 Feb 2012 04:16:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Ben</title>
		<link>http://www.philosophicalgeek.com/2007/12/27/easily-unit-testing-event-handlers/comment-page-1/#comment-165509</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Wed, 27 Oct 2010 01:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.philosophicalgeek.com/2007/12/27/easily-unit-testing-event-handlers/#comment-165509</guid>
		<description>Matthew, I don&#039;t think that will work because if that event handler is not called, then no assertion will be raised, thus the test passes erroneously.</description>
		<content:encoded><![CDATA[<p>Matthew, I don&#8217;t think that will work because if that event handler is not called, then no assertion will be raised, thus the test passes erroneously.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Oberlin</title>
		<link>http://www.philosophicalgeek.com/2007/12/27/easily-unit-testing-event-handlers/comment-page-1/#comment-165444</link>
		<dc:creator>Matthew Oberlin</dc:creator>
		<pubDate>Tue, 26 Oct 2010 18:05:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.philosophicalgeek.com/2007/12/27/easily-unit-testing-event-handlers/#comment-165444</guid>
		<description>There is actually an easier way to do this using anonymous methods...

&lt;code&gt;
[Test]
public void CheckStats()
{
BrickDatabase db = new BrickDatabase(tempFolder, maxCacheAge);

db.InventoryStatsUpdated += delegate
{
Assert.IsTrue(true);
};

db.DoSomethingThatFiresEvent();
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>There is actually an easier way to do this using anonymous methods&#8230;</p>
<p><code><br />
[Test]<br />
public void CheckStats()<br />
{<br />
BrickDatabase db = new BrickDatabase(tempFolder, maxCacheAge);</p>
<p>db.InventoryStatsUpdated += delegate<br />
{<br />
Assert.IsTrue(true);<br />
};</p>
<p>db.DoSomethingThatFiresEvent();<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhuri Venkatesh</title>
		<link>http://www.philosophicalgeek.com/2007/12/27/easily-unit-testing-event-handlers/comment-page-1/#comment-129294</link>
		<dc:creator>Madhuri Venkatesh</dc:creator>
		<pubDate>Thu, 21 Jan 2010 08:06:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.philosophicalgeek.com/2007/12/27/easily-unit-testing-event-handlers/#comment-129294</guid>
		<description>This is really smart. Thanks, but there could be a memory leak if we do not un-register the event-handler. 
See http://bytes.com/topic/c-sharp/answers/276123-memory-leak-c-2-0-w-anonymous-delegates</description>
		<content:encoded><![CDATA[<p>This is really smart. Thanks, but there could be a memory leak if we do not un-register the event-handler.<br />
See <a href="http://bytes.com/topic/c-sharp/answers/276123-memory-leak-c-2-0-w-anonymous-delegates" rel="nofollow">http://bytes.com/topic/c-sharp/answers/276123-memory-leak-c-2-0-w-anonymous-delegates</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Helpware</title>
		<link>http://www.philosophicalgeek.com/2007/12/27/easily-unit-testing-event-handlers/comment-page-1/#comment-64303</link>
		<dc:creator>Helpware</dc:creator>
		<pubDate>Sun, 12 Oct 2008 14:07:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.philosophicalgeek.com/2007/12/27/easily-unit-testing-event-handlers/#comment-64303</guid>
		<description>Brilliant. This code was a great help.
Thanks very much.
Rob</description>
		<content:encoded><![CDATA[<p>Brilliant. This code was a great help.<br />
Thanks very much.<br />
Rob</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Randolpho</title>
		<link>http://www.philosophicalgeek.com/2007/12/27/easily-unit-testing-event-handlers/comment-page-1/#comment-60340</link>
		<dc:creator>Randolpho</dc:creator>
		<pubDate>Thu, 11 Sep 2008 18:07:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.philosophicalgeek.com/2007/12/27/easily-unit-testing-event-handlers/#comment-60340</guid>
		<description>Thanks for the tip, it&#039;s one that I&#039;ll remember.

Or, barring that, one I&#039;ll return to with my new bookmark. :)</description>
		<content:encoded><![CDATA[<p>Thanks for the tip, it&#8217;s one that I&#8217;ll remember.</p>
<p>Or, barring that, one I&#8217;ll return to with my new bookmark. <img src='http://www.philosophicalgeek.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: saintc0d3r</title>
		<link>http://www.philosophicalgeek.com/2007/12/27/easily-unit-testing-event-handlers/comment-page-1/#comment-50524</link>
		<dc:creator>saintc0d3r</dc:creator>
		<pubDate>Fri, 11 Jul 2008 05:45:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.philosophicalgeek.com/2007/12/27/easily-unit-testing-event-handlers/#comment-50524</guid>
		<description>Excellent one..thanx for the insight that u describe through this article ..:-)</description>
		<content:encoded><![CDATA[<p>Excellent one..thanx for the insight that u describe through this article ..:-)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

