<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Pimp your VSTT exception tests</title><link>http://blogs.msdn.com/ddietric/archive/2008/07/31/pimp-your-vstt-exception-tests.aspx</link><description>Writing unit tests in VSTT is great since it comes with a nice unit testing framework and the test tools are neatly integrated into Visual Studio. There is one exception though: Exception testing (yes, that pun was intended). Consider the following example:</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Dew Drop - July 31, 2008 | Alvin Ashcraft's Morning Dew</title><link>http://blogs.msdn.com/ddietric/archive/2008/07/31/pimp-your-vstt-exception-tests.aspx#8793393</link><pubDate>Thu, 31 Jul 2008 17:39:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8793393</guid><dc:creator>Dew Drop - July 31, 2008 | Alvin Ashcraft's Morning Dew</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.alvinashcraft.com/2008/07/31/dew-drop-july-31-2008/"&gt;http://www.alvinashcraft.com/2008/07/31/dew-drop-july-31-2008/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Pimp your VSTT exception tests</title><link>http://blogs.msdn.com/ddietric/archive/2008/07/31/pimp-your-vstt-exception-tests.aspx#8794298</link><pubDate>Thu, 31 Jul 2008 21:57:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8794298</guid><dc:creator>marinosc</dc:creator><description>&lt;p&gt;I definitely agree with this approach to exception testing. &amp;nbsp;It's very easy to implement, &amp;nbsp;saves you a bunch of duplicated code, and allows you to specify the exact line of code that you expect the exception to occur on. &amp;nbsp;I actually wrote a very similar blog post to this one in early June:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://srtsolutions.com/blogs/chrismarinos/archive/2008/06/06/testing-for-exceptions-in-unit-test-frameworks.aspx"&gt;http://srtsolutions.com/blogs/chrismarinos/archive/2008/06/06/testing-for-exceptions-in-unit-test-frameworks.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Pimp your VSTT exception tests</title><link>http://blogs.msdn.com/ddietric/archive/2008/07/31/pimp-your-vstt-exception-tests.aspx#8794511</link><pubDate>Thu, 31 Jul 2008 22:36:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8794511</guid><dc:creator>ddietric</dc:creator><description>&lt;p&gt;Hey Chris! I hadn't seen your post before. Thanks for stopping by and sharing! There is one interesting difference though: I noticed that instead of catching all exceptions and then performing a type comparison you have a catch block handling the exceptions of the type passed in as the type parameter which immediately returns. This means that your tests will also pass if the exception type thrown is derived from what you expected. I wonder if this has caused any false positives?&lt;/p&gt;
&lt;p&gt;D.C.&lt;/p&gt;
</description></item><item><title>VSTS Links - 08/04/2008</title><link>http://blogs.msdn.com/ddietric/archive/2008/07/31/pimp-your-vstt-exception-tests.aspx#8831207</link><pubDate>Mon, 04 Aug 2008 18:05:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8831207</guid><dc:creator>Team System News</dc:creator><description>&lt;p&gt;Jeff Levinson on What Can You Use TFS For? Eugene Zakehareyev on Work Item Customization tidbits: Special...&lt;/p&gt;
</description></item><item><title>The ultimate ExceptionAssert.Throws() method</title><link>http://blogs.msdn.com/ddietric/archive/2008/07/31/pimp-your-vstt-exception-tests.aspx#9286958</link><pubDate>Wed, 07 Jan 2009 10:17:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9286958</guid><dc:creator>Dennis "D.C." Dietrich</dc:creator><description>&lt;p&gt;A while ago I published a post titled Pimp your VSTT exception tests in which I pointed out some disadvantages&lt;/p&gt;
</description></item></channel></rss>