<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blog.alecl.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>Syntactic Sugar for Thrown Exception Checking with Generics</title><link>http://blog.alecl.com/archive/2008/10/25/syntactic-sugar-for-thrown-exception-checking-with-generics.aspx</link><description>Using attributes like [ExpectedException] can obscure intent because they apply to the whole method instead of a specific call you're checking. To make intent totally clear and prevent unexpected bugs, you should wrap just the statement you're expecting</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.2)</generator><item><title>re: Syntactic Sugar for Thrown Exception Checking with Generics</title><link>http://blog.alecl.com/archive/2008/10/25/syntactic-sugar-for-thrown-exception-checking-with-generics.aspx#32</link><pubDate>Mon, 16 Mar 2009 22:40:35 GMT</pubDate><guid isPermaLink="false">022ae8cf-15ca-4180-8062-b150ad1660bf:32</guid><dc:creator>mjcarrabine</dc:creator><description>&lt;p&gt;I am new to unit testing (using MSTest). Having quickly discovered the limitations of the ExpectedException attribute, I was searching for better approach, and this is tremendously helpful.&lt;/p&gt;
&lt;p&gt;One question, how would I modify your helper functions to allow methodcalls that take parameters?&lt;/p&gt;
&lt;p&gt;I would expect it would use Func&amp;lt;T,TResult&amp;gt; instead of Action, but I am also new to delegates, so I am unsure if this is possible.&lt;/p&gt;
&lt;p&gt;Thanks again.&lt;/p&gt;</description></item></channel></rss>