<?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/"
	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>Comments on: Unit testing with Visual Studio 2008 &#8211; Part 2</title>
	<atom:link href="http://freekleemhuis.com/2008/06/26/unit-testing-with-visual-studio-2008-part-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://freekleemhuis.com/2008/06/26/unit-testing-with-visual-studio-2008-part-2/</link>
	<description>SoftWear 'n Tears</description>
	<lastBuildDate>Mon, 24 Oct 2011 20:02:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Unit testing part 3: Design for testability &#171; Freekshow</title>
		<link>http://freekleemhuis.com/2008/06/26/unit-testing-with-visual-studio-2008-part-2/#comment-50</link>
		<dc:creator><![CDATA[Unit testing part 3: Design for testability &#171; Freekshow]]></dc:creator>
		<pubDate>Wed, 03 Sep 2008 11:21:47 +0000</pubDate>
		<guid isPermaLink="false">http://freekleemhuis.wordpress.com/?p=74#comment-50</guid>
		<description><![CDATA[[...] @ 11:20 am   This is part 3 in a series of posts about unit testing using Visual Studio. Part 1 and part 2 focused mainly on the MS Test environment within Visual [...]]]></description>
		<content:encoded><![CDATA[<p>[...] @ 11:20 am   This is part 3 in a series of posts about unit testing using Visual Studio. Part 1 and part 2 focused mainly on the MS Test environment within Visual [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joelcochran</title>
		<link>http://freekleemhuis.com/2008/06/26/unit-testing-with-visual-studio-2008-part-2/#comment-47</link>
		<dc:creator><![CDATA[joelcochran]]></dc:creator>
		<pubDate>Thu, 31 Jul 2008 14:25:17 +0000</pubDate>
		<guid isPermaLink="false">http://freekleemhuis.wordpress.com/?p=74#comment-47</guid>
		<description><![CDATA[Hi Freek,

I&#039;m just getting back to this.  It does make sense, and I guess it would be readily apparent to someone with more experience Unit Testing.  You are probably right on the alternative approach, it creates more questions that need to be answered.  One thing that I failed to mention that I really do like about your approach is its brevity.  And now that I understand it a bit better, I&#039;m sure I will be using this going forward.

I do enjoy sharing code, and I never get defensive about it because there is almost always a better way to do things.  Thanks to you as well for being willing to share your knowledge and techniques: the community makes us all better developers.

Joel]]></description>
		<content:encoded><![CDATA[<p>Hi Freek,</p>
<p>I&#8217;m just getting back to this.  It does make sense, and I guess it would be readily apparent to someone with more experience Unit Testing.  You are probably right on the alternative approach, it creates more questions that need to be answered.  One thing that I failed to mention that I really do like about your approach is its brevity.  And now that I understand it a bit better, I&#8217;m sure I will be using this going forward.</p>
<p>I do enjoy sharing code, and I never get defensive about it because there is almost always a better way to do things.  Thanks to you as well for being willing to share your knowledge and techniques: the community makes us all better developers.</p>
<p>Joel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://freekleemhuis.com/2008/06/26/unit-testing-with-visual-studio-2008-part-2/#comment-46</link>
		<dc:creator><![CDATA[Peter]]></dc:creator>
		<pubDate>Thu, 31 Jul 2008 00:58:35 +0000</pubDate>
		<guid isPermaLink="false">http://freekleemhuis.wordpress.com/?p=74#comment-46</guid>
		<description><![CDATA[Hi Freek,

Thanks for all these useful information on unit testing.  For a project which has already started, is that a way to add unit tests programmatically?  What is the guideline to separate different tests into different test projects?  One area that I want to know more is data-driven unit testing.  Do you have information in that area?

Thanks]]></description>
		<content:encoded><![CDATA[<p>Hi Freek,</p>
<p>Thanks for all these useful information on unit testing.  For a project which has already started, is that a way to add unit tests programmatically?  What is the guideline to separate different tests into different test projects?  One area that I want to know more is data-driven unit testing.  Do you have information in that area?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Freek Leemhuis</title>
		<link>http://freekleemhuis.com/2008/06/26/unit-testing-with-visual-studio-2008-part-2/#comment-45</link>
		<dc:creator><![CDATA[Freek Leemhuis]]></dc:creator>
		<pubDate>Mon, 30 Jun 2008 11:01:03 +0000</pubDate>
		<guid isPermaLink="false">http://freekleemhuis.wordpress.com/?p=74#comment-45</guid>
		<description><![CDATA[Hi Joel,
We are all learning as we go along, and I&#039;ve certainly had plenty of comments on the stuff I write, sometimes there&#039;s no better code review than posting this stuff out into the open! So kudos to you for doing that.
As for the alternative solution you&#039;ve posted above, what if you get a different type of exception then ArgumentException? Will you not get a type conversion error in your catch block? 
Using the ExpectedException attribute, you don&#039;t actually need an Assert, the test will fail if the expected exception is not thrown, and succeed if the specified exception is indeed thrown.]]></description>
		<content:encoded><![CDATA[<p>Hi Joel,<br />
We are all learning as we go along, and I&#8217;ve certainly had plenty of comments on the stuff I write, sometimes there&#8217;s no better code review than posting this stuff out into the open! So kudos to you for doing that.<br />
As for the alternative solution you&#8217;ve posted above, what if you get a different type of exception then ArgumentException? Will you not get a type conversion error in your catch block?<br />
Using the ExpectedException attribute, you don&#8217;t actually need an Assert, the test will fail if the expected exception is not thrown, and succeed if the specified exception is indeed thrown.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joelcochran</title>
		<link>http://freekleemhuis.com/2008/06/26/unit-testing-with-visual-studio-2008-part-2/#comment-44</link>
		<dc:creator><![CDATA[joelcochran]]></dc:creator>
		<pubDate>Fri, 27 Jun 2008 14:17:57 +0000</pubDate>
		<guid isPermaLink="false">http://freekleemhuis.wordpress.com/?p=74#comment-44</guid>
		<description><![CDATA[Yes, as I mentioned in my post, I certainly have much to learn.  One of the comments showed an alternate way to do this by creating a local ArgumentException variable and only populating it if the exception was properly thrown:

[TestMethod]
public void TestZipCodeNumericButGreaterThan99999()
{
TransactionRequestInfo req = new TransactionRequestInfo();
string testValue = “58634789″;

ArgumentException thrownException = null;
try
{
req.Zip = testValue;
}
catch (ArgumentException aex)
{
thrownException = aex;
}

Assert.IsNotNull(thrownException, “Proper exception not thrown.”);
}

I liked this idea because it limits the method to a single Assertion, which seems like it would be ideal to me.  I also like your approach, and I will definitely give it a spin, but what I do not like about it is that it is not readily apparent what the end result will/should be because there is NO Assertion statement.

Thanks for the bits about initialize and cleanup, they will definitely come in handy]]></description>
		<content:encoded><![CDATA[<p>Yes, as I mentioned in my post, I certainly have much to learn.  One of the comments showed an alternate way to do this by creating a local ArgumentException variable and only populating it if the exception was properly thrown:</p>
<p>[TestMethod]<br />
public void TestZipCodeNumericButGreaterThan99999()<br />
{<br />
TransactionRequestInfo req = new TransactionRequestInfo();<br />
string testValue = “58634789″;</p>
<p>ArgumentException thrownException = null;<br />
try<br />
{<br />
req.Zip = testValue;<br />
}<br />
catch (ArgumentException aex)<br />
{<br />
thrownException = aex;<br />
}</p>
<p>Assert.IsNotNull(thrownException, “Proper exception not thrown.”);<br />
}</p>
<p>I liked this idea because it limits the method to a single Assertion, which seems like it would be ideal to me.  I also like your approach, and I will definitely give it a spin, but what I do not like about it is that it is not readily apparent what the end result will/should be because there is NO Assertion statement.</p>
<p>Thanks for the bits about initialize and cleanup, they will definitely come in handy</p>
]]></content:encoded>
	</item>
</channel>
</rss>

