<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>should Discussions Rss Feed</title><link>http://should.codeplex.com/Thread/List.aspx</link><description>should Discussions Rss Description</description><item><title>New Post: New Release and Nuget package?</title><link>http://should.codeplex.com/discussions/247927</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I filled out their form and they are going to hook up the CI off of the current nant build.. once we get it working we can conver that old build to something newer.&lt;/p&gt;
&lt;p&gt;The source is now on github.com/erichexter/should&amp;nbsp; feel free to submit pull requests.&lt;/p&gt;&lt;/div&gt;</description><author>erichexter</author><pubDate>Wed, 23 May 2012 18:27:59 GMT</pubDate><guid isPermaLink="false">New Post: New Release and Nuget package? 20120523062759P</guid></item><item><title>New Post: New Release and Nuget package?</title><link>http://should.codeplex.com/discussions/247927</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Perfect, I'll get on it.&lt;/p&gt;
&lt;p&gt;I'm not sure what version they are running, I'll check it out.&lt;/p&gt;&lt;/div&gt;</description><author>mikeobrien</author><pubDate>Tue, 22 May 2012 14:49:21 GMT</pubDate><guid isPermaLink="false">New Post: New Release and Nuget package? 20120522024921P</guid></item><item><title>New Post: New Release and Nuget package?</title><link>http://should.codeplex.com/discussions/247927</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;yes.. I think I would like to publish the ci to a myfeed feed and then just publish releases to the public nuget.. i assume the codebetter server is using TC 7? so the nuget setup is super easy.&lt;/p&gt;&lt;/div&gt;</description><author>erichexter</author><pubDate>Tue, 22 May 2012 14:34:07 GMT</pubDate><guid isPermaLink="false">New Post: New Release and Nuget package? 20120522023407P</guid></item><item><title>New Post: New Release and Nuget package?</title><link>http://should.codeplex.com/discussions/247927</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Awesome! You still interested in getting an automated build/deploy going? If so I can get a script written and get eveything setup on the code better CI server.&lt;/p&gt;&lt;/div&gt;</description><author>mikeobrien</author><pubDate>Tue, 22 May 2012 14:23:06 GMT</pubDate><guid isPermaLink="false">New Post: New Release and Nuget package? 20120522022306P</guid></item><item><title>New Post: IHideObjectMembers</title><link>http://should.codeplex.com/discussions/230878</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I think that is a great idea.. &amp;nbsp;we do take pull requests.. i&lt;/p&gt;&lt;/div&gt;</description><author>erichexter</author><pubDate>Tue, 22 May 2012 14:15:05 GMT</pubDate><guid isPermaLink="false">New Post: IHideObjectMembers 20120522021505P</guid></item><item><title>New Post: New Release and Nuget package?</title><link>http://should.codeplex.com/discussions/247927</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;With the release of Github for Windows.. I talked it over with Tim and we are willing to move to github. &amp;nbsp;I will apply the current pull requests and we can get this thing moved.&lt;/p&gt;&lt;/div&gt;</description><author>erichexter</author><pubDate>Tue, 22 May 2012 14:13:19 GMT</pubDate><guid isPermaLink="false">New Post: New Release and Nuget package? 20120522021319P</guid></item><item><title>New Post: New Release and Nuget package?</title><link>http://should.codeplex.com/discussions/247927</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I second Mike. &amp;nbsp;I had a similar thought.&lt;/p&gt;&lt;/div&gt;</description><author>taylonr</author><pubDate>Sat, 19 May 2012 20:48:56 GMT</pubDate><guid isPermaLink="false">New Post: New Release and Nuget package? 20120519084856P</guid></item><item><title>New Post: New Release and Nuget package?</title><link>http://should.codeplex.com/discussions/247927</link><description>&lt;div style="line-height: normal;"&gt;&lt;blockquote style="border: solid .1em #ccc; font-style: italic; margin: .25em 1em 0 1em; padding: 0 .25em 0 .25em;"&gt;&lt;strong&gt;erichexter wrote:&lt;/strong&gt;&lt;br /&gt; I can put together a new release on nuget... It is easier for me to just script out the nuget push in our ci server than to manually update the releases on the codeplex project. I have so many OSS projects going right now, I am running out of bandwidth to keep  it all going.
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;That being said, if someone would like to act as a release manager for this project, I would certainly appreciate the help!&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;What would you think about moving the source to github and we could setup an automated build (And nuget push) on the codebetter CI? I'd be willing to handle this if it's ok w/ you.&lt;/p&gt;&lt;/div&gt;</description><author>mikeobrien</author><pubDate>Sun, 06 May 2012 17:00:57 GMT</pubDate><guid isPermaLink="false">New Post: New Release and Nuget package? 20120506050057P</guid></item><item><title>New Post: Review after playing with it for a while</title><link>http://should.codeplex.com/discussions/275940</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;This library is great.&amp;nbsp; I really like that I don't have to type open and close parens () for every part of the assertion.&lt;/p&gt;
&lt;p&gt;One thing that is missing is that the &amp;quot;Error Message&amp;quot; needs to be more brief when an assertion fails.&amp;nbsp; For example: this is a current error message:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; Test method IntegrationTests.IntegrationOrderTests.SaveNewOrders_NormalOrders_NoErrors threw exception:
&lt;br&gt;
&amp;nbsp;&amp;nbsp; Should.Core.Exceptions.EqualException: Assert.Equal() Failure&lt;br&gt;
&amp;nbsp;&amp;nbsp; Expected: 1&lt;br&gt;
&amp;nbsp;&amp;nbsp; Actual:&amp;nbsp;&amp;nbsp; 2&lt;/p&gt;
&lt;p&gt;I know what method failed already.&amp;nbsp; What I really want to see in the Error Message is this:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; Expected: 1&amp;nbsp; &amp;nbsp; Actual:&amp;nbsp;&amp;nbsp; 2&lt;/p&gt;
&lt;p&gt;That way I don't have to open up the results of every test that failed to see that the assertion failed.&lt;/p&gt;
&lt;/div&gt;</description><author>Vaccano</author><pubDate>Fri, 14 Oct 2011 18:53:23 GMT</pubDate><guid isPermaLink="false">New Post: Review after playing with it for a while 20111014065323P</guid></item><item><title>New Post: New Release and Nuget package?</title><link>http://should.codeplex.com/discussions/247927</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Would not be best to join efforts under the FluentAssertions library (http://fluentassertions.codeplex.com)? &amp;nbsp;Should assertion library and FluentAssertions seems to have the same goal and a similar syntax.&lt;/p&gt;
&lt;p&gt;There's also frequent updates. &amp;nbsp;It may not be as clean as the source code of the should library but it could relieve you of one project and all the release process.&lt;/p&gt;
&lt;p&gt;And the community would certainly benefit of your contribution on this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Phil&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>jesuissur</author><pubDate>Fri, 03 Jun 2011 15:14:05 GMT</pubDate><guid isPermaLink="false">New Post: New Release and Nuget package? 20110603031405P</guid></item><item><title>New Post: New Release and Nuget package?</title><link>http://should.codeplex.com/discussions/247927</link><description>&lt;div style="line-height: normal;"&gt;I can put together a new release on nuget... It is easier for me to just script out the nuget push in our ci server than to manually update the releases on the codeplex project. I have so many OSS projects going right now, I am running out of bandwidth
 to keep it all going.
&lt;div&gt;&lt;br&gt;
&lt;/div&gt;
&lt;div&gt;That being said, if someone would like to act as a release manager for this project, I would certainly appreciate the help!&lt;/div&gt;
&lt;/div&gt;</description><author>erichexter</author><pubDate>Mon, 07 Mar 2011 14:44:08 GMT</pubDate><guid isPermaLink="false">New Post: New Release and Nuget package? 20110307024408P</guid></item><item><title>New Post: New Release and Nuget package?</title><link>http://should.codeplex.com/discussions/247927</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;+1 to Mike's question. I decided to use to ShouldFluent, but there is no between (IncludedIn) assertion for datetime. With new model ( IBe&amp;lt;DateTime&amp;gt;) its very easy to write. But this new model is not included to v12.&lt;/p&gt;&lt;/div&gt;</description><author>chaliy</author><pubDate>Mon, 07 Mar 2011 14:39:39 GMT</pubDate><guid isPermaLink="false">New Post: New Release and Nuget package? 20110307023939P</guid></item><item><title>New Post: New Release and Nuget package?</title><link>http://should.codeplex.com/discussions/247927</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Any plans on doing a release? There are some goodies added since the last release that look mighty tasty (e.g Greater/Less/OrEqual/Than, ShouldBeType&amp;lt;T&amp;gt;, etc).&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;m&lt;/p&gt;
&lt;/div&gt;</description><author>mikeobrien</author><pubDate>Mon, 28 Feb 2011 23:26:03 GMT</pubDate><guid isPermaLink="false">New Post: New Release and Nuget package? 20110228112603P</guid></item><item><title>New Post: ShouldBeThrownBy</title><link>http://should.codeplex.com/Thread/View.aspx?ThreadId=239412</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Mel,&lt;/p&gt;
&lt;p&gt;A simple extension method for an Action will give you the syntax that you want (it's not the lambda's that cause the problem other than the ()=&amp;gt; thingamajig)&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;    &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; &lt;span style="color:blue"&gt;class&lt;/span&gt; ShouldExtensions
    {
        &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; ShouldThrow Should(&lt;span style="color:blue"&gt;this&lt;/span&gt; Action action)
        {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; &lt;span style="color:blue"&gt;new&lt;/span&gt; ShouldThrow(action);
        }
    }

when combining this with the ShouldThrow class:&lt;/pre&gt;
&lt;pre&gt;&lt;div style="color:black; background-color:white"&gt;&lt;pre&gt;    &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;class&lt;/span&gt; ShouldThrow : ShouldBase&amp;lt;ShouldThrow, Action, BeAction&amp;gt;
    {
        &lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;readonly&lt;/span&gt; Action _action;

        &lt;span style="color:blue"&gt;public&lt;/span&gt; ShouldThrow(Action target) 
            : base(target, ShouldExtensions.AssertProvider)
        {
            _action = target;
        }

        &lt;span style="color:blue"&gt;public&lt;/span&gt; Action Action
        {
            &lt;span style="color:blue"&gt;get&lt;/span&gt; { &lt;span style="color:blue"&gt;return&lt;/span&gt; _action; }
        }

        &lt;span style="color:blue"&gt;public&lt;/span&gt; Exception &lt;span style="color:blue"&gt;Throw&lt;/span&gt;()
        {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; Be.Throwing&amp;lt;Exception&amp;gt;();
        }

        &lt;span style="color:blue"&gt;public&lt;/span&gt; TEx &lt;span style="color:blue"&gt;Throw&lt;/span&gt;&amp;lt;TEx&amp;gt;()
            &lt;span style="color:blue"&gt;where&lt;/span&gt; TEx : Exception
        {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; Be.Throwing&amp;lt;TEx&amp;gt;();
        }

        &lt;span style="color:blue"&gt;public&lt;/span&gt; TEx ThrowBaseOf&amp;lt;TEx&amp;gt;()
            &lt;span style="color:blue"&gt;where&lt;/span&gt; TEx : Exception
        {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; Be.ThrowingBaseOf&amp;lt;TEx&amp;gt;();
        }

        &lt;span style="color:blue"&gt;public&lt;/span&gt; Exception ThrowBaseOf(Type type)
        {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; Be.ThrowingBaseOf(type);
        }

        &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;new&lt;/span&gt; ShouldThrow &lt;span style="color:blue"&gt;Not&lt;/span&gt;
        {
            &lt;span style="color:blue"&gt;get&lt;/span&gt; { 
                Negate = !Negate;
                &lt;span style="color:blue"&gt;return&lt;/span&gt; this;
            }
        }

        internal bool Negate { &lt;span style="color:blue"&gt;get&lt;/span&gt;; &lt;span style="color:blue"&gt;set&lt;/span&gt;; }

    }

and of course the BeAction (I wasn't sure what to call that!)&lt;/pre&gt;
&lt;pre&gt;&lt;div style="color:black; background-color:white"&gt;&lt;pre&gt;    &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;class&lt;/span&gt; BeAction
    {
        &lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;readonly&lt;/span&gt; ShouldThrow _should;

        &lt;span style="color:blue"&gt;public&lt;/span&gt; BeAction(ShouldThrow should, IAssertProvider assertProvider)
        {
            _should = should;
        }

        &lt;span style="color:blue"&gt;public&lt;/span&gt; Exception Throwing()
        {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; ThrowingInternal&amp;lt;Exception&amp;gt;(ex =&amp;gt; ex, MatchAnything);
        }

        &lt;span style="color:blue"&gt;public&lt;/span&gt; TEx Throwing&amp;lt;TEx&amp;gt;()
            &lt;span style="color:blue"&gt;where&lt;/span&gt; TEx : Exception
        {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; ThrowingInternal&amp;lt;TEx&amp;gt;(
                ex =&amp;gt; ex,
                ex =&amp;gt; &lt;span style="color:blue"&gt;typeof&lt;/span&gt;(TEx).Equals(ex.GetType()));
        }

        &lt;span style="color:blue"&gt;public&lt;/span&gt; Exception Throwing(Type exceptionType)
        {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; ThrowingInternal&amp;lt;Exception&amp;gt;(ex =&amp;gt; ex, 
                ex =&amp;gt; exceptionType.Equals(ex.GetType()));
        }

        &lt;span style="color:blue"&gt;public&lt;/span&gt; TEx ThrowingBaseOf&amp;lt;TEx&amp;gt;()
            &lt;span style="color:blue"&gt;where&lt;/span&gt; TEx : Exception
        {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; ThrowingInternal&amp;lt;TEx&amp;gt;(
                ex =&amp;gt; ex.GetBaseException(),
                ex =&amp;gt; &lt;span style="color:blue"&gt;typeof&lt;/span&gt;(TEx).Equals(ex.GetBaseException().GetType()));
        }

        &lt;span style="color:blue"&gt;public&lt;/span&gt; Exception ThrowingBaseOf(Type exceptionType)
        {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; ThrowingInternal&amp;lt;Exception&amp;gt;(ex =&amp;gt; ex,
                ex =&amp;gt; exceptionType.Equals(ex.GetBaseException().GetType()));
        }

        &lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; &lt;span style="color:blue"&gt;bool&lt;/span&gt; MatchAnything(Exception ex)
        {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; &lt;span style="color:blue"&gt;true&lt;/span&gt;;
        }

        &lt;span style="color:blue"&gt;private&lt;/span&gt; TEx ThrowingInternal&amp;lt;TEx&amp;gt;(Func&amp;lt;Exception, Exception&amp;gt; exceptionGetter, Predicate&amp;lt;Exception&amp;gt; exceptionMatcher)
            &lt;span style="color:blue"&gt;where&lt;/span&gt; TEx : Exception
        {
            &lt;span style="color:blue"&gt;var&lt;/span&gt; actual = exceptionGetter(RecordException(_should.Action));

            &lt;span style="color:blue"&gt;if&lt;/span&gt; (_should.Negate)
            {
                &lt;span style="color:blue"&gt;if&lt;/span&gt; (actual != &lt;span style="color:blue"&gt;null&lt;/span&gt;)
                {
                    &lt;span style="color:blue"&gt;throw&lt;/span&gt; &lt;span style="color:blue"&gt;new&lt;/span&gt; DoesNotThrowException(actual);
                }

                &lt;span style="color:blue"&gt;return&lt;/span&gt; &lt;span style="color:blue"&gt;null&lt;/span&gt;;
            }

            &lt;span style="color:blue"&gt;if&lt;/span&gt; (actual == &lt;span style="color:blue"&gt;null&lt;/span&gt;)
            {
                &lt;span style="color:blue"&gt;throw&lt;/span&gt; &lt;span style="color:blue"&gt;new&lt;/span&gt; ThrowsException(&lt;span style="color:blue"&gt;typeof&lt;/span&gt;(TEx));
            }

            &lt;span style="color:blue"&gt;if&lt;/span&gt; (!exceptionMatcher(actual))
            {
                &lt;span style="color:blue"&gt;throw&lt;/span&gt; &lt;span style="color:blue"&gt;new&lt;/span&gt; ThrowsException(&lt;span style="color:blue"&gt;typeof&lt;/span&gt;(TEx), actual);
            }

            &lt;span style="color:blue"&gt;return&lt;/span&gt; (TEx)actual;
        }

        &lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; Exception RecordException(Action action)
        {
            &lt;span style="color:blue"&gt;try&lt;/span&gt;
            {
                action.Invoke();
                &lt;span style="color:blue"&gt;return&lt;/span&gt; &lt;span style="color:blue"&gt;null&lt;/span&gt;;
            }
            &lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
            {
                &lt;span style="color:blue"&gt;return&lt;/span&gt; ex;
            }
        }
    }
&lt;/pre&gt;
&lt;pre&gt;NOTE - I didn't put this into a branch as I wasn't sure where the new code base was going. All of this is working nicely for me. &lt;/pre&gt;
&lt;pre&gt;Also, note that the Executing.This() utility class just makes it easier to consume a lambda expression and convert it (without the ugly casting or temporary Action variable).&lt;/pre&gt;
&lt;pre&gt;&lt;div style="color:black; background-color:white"&gt;&lt;pre&gt;    &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; &lt;span style="color:blue"&gt;class&lt;/span&gt; Executing
    {
        &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; Action This(Action action)
        {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; action;
        }
    }

With all of that combined you can have code like this:&lt;/pre&gt;
&lt;pre&gt;&lt;div style="color:black; background-color:white"&gt;&lt;pre&gt;Executing.This( () =&amp;gt; &lt;span style="color:blue"&gt;new&lt;/span&gt; ArgumentException() )
    .Should().Throw&amp;lt;ArgumentException&amp;gt;();

&lt;span style="color:green"&gt;// alternatively...&lt;/span&gt;

Executing.This( () =&amp;gt; &lt;span style="color:blue"&gt;new&lt;/span&gt; ArgumentException() )
    .Should().Be.Throwing&amp;lt;ArgumentException&amp;gt;();

&lt;/pre&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;</description><author>CodeMonkeyKing</author><pubDate>Mon, 17 Jan 2011 23:48:58 GMT</pubDate><guid isPermaLink="false">New Post: ShouldBeThrownBy 20110117114858P</guid></item><item><title>New Post: ShouldBeThrownBy</title><link>http://should.codeplex.com/Thread/View.aspx?ThreadId=239412</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;I tried for a while last night to build a decent fluent version of ShouldThrow, and I'm just not getting it. I ran into this same problem with the GreaterThan and LessThan stuff. I just don't GET fluent interfaces as well as I should. I mean, I know how
 to use them, but building them hurts my head. I know what I would like this to look like:&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;Action action = () =&amp;gt; &lt;span style="color:blue"&gt;throw&lt;/span&gt; &lt;span style="color:blue"&gt;new&lt;/span&gt; ArgumentException();
action.Should().Throw&amp;lt;ArgumentException&amp;gt;();
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;That would be my ideal &amp;quot;fluent&amp;quot; version of the above, but getting there is proving to be a bit of a challenge. Since all the other &amp;quot;should&amp;quot;s hang off of Be, I would need to do something like what CodeMonkeyKing mentioned above (Should().Be.Throwing...) which
 I don't like at all. If the whole point of a fluent interface is to make things read like a sentence, then why would I want it to sound like a badly-translated one? So it seems to me that I would need to build a &amp;quot;Throw&amp;quot; class that would be a peer of &amp;quot;Be&amp;quot;.
 Can anyone give me any advice on how to wrap my head around the fluent stuff? Alternately, would anyone care to collaborate on this one? I've got the plain old .ShouldThrow pretty much worked out. It's a grand total of TWO whole methods. The only thing I have
 to work on now is whether ShouldNotThrow even makes sense. Most of the other Shoulds have Nots, but here it just doesn't seem to make any sense. After all, testing whether code throws an exception is already there for free. You just test the method, and if
 nothing throws, then the test passes. Testing solely for the non-presence of a specific exception seems really sloppy to me.&lt;/p&gt;
&lt;p&gt;MG2&lt;/p&gt;
&lt;/div&gt;</description><author>MelGrubb</author><pubDate>Mon, 17 Jan 2011 18:35:45 GMT</pubDate><guid isPermaLink="false">New Post: ShouldBeThrownBy 20110117063545P</guid></item><item><title>New Post: ShouldBeThrownBy</title><link>http://should.codeplex.com/Thread/View.aspx?ThreadId=239412</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Mel,&lt;/p&gt;
&lt;p&gt;That's great. You can also drop in this simple 'static factory' class. It isn't less typing but it does read better:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:Consolas; font-size:x-small"&gt;&lt;span style="font-family:Consolas; font-size:x-small"&gt;&lt;span style="font-family:Consolas; font-size:x-small"&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; &lt;span style="color:blue"&gt;class&lt;/span&gt; Executing
{
    &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; Action This(Action action)
    {
        &lt;span style="color:blue"&gt;return&lt;/span&gt; action;
    }
}

&lt;/pre&gt;
&lt;/div&gt;
&lt;span style="font-family:Consolas; font-size:x-small"&gt;&lt;span style="font-family:Consolas; font-size:x-small"&gt;&lt;span style="font-family:Consolas; font-size:x-small"&gt;
&lt;p&gt;then your code will read Executing.This(() =&amp;gt; ThrowingMethod()).ShouldThrows&amp;lt;ExpectedExceptionType&amp;gt;();&lt;/p&gt;
&lt;p&gt;This was borrowed from the SharpTestEx project.&lt;/p&gt;
&lt;span style="font-family:Consolas; font-size:x-small"&gt;&lt;span style="font-family:Consolas; font-size:x-small"&gt;&lt;font face="Consolas" size="2"&gt;
&lt;p&gt;-- John&lt;/p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas; font-size:x-small"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas; font-size:x-small"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas; font-size:x-small"&gt;&lt;/span&gt;
&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;</description><author>CodeMonkeyKing</author><pubDate>Fri, 14 Jan 2011 21:07:50 GMT</pubDate><guid isPermaLink="false">New Post: ShouldBeThrownBy 20110114090750P</guid></item><item><title>New Post: ShouldBeThrownBy</title><link>http://should.codeplex.com/Thread/View.aspx?ThreadId=239412</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Okay, I've got something that seems to be working now. It is most easily used in a test like this:&lt;/p&gt;
&lt;pre&gt;Action action = () =&amp;gt; ThrowingMethod();
action.ShouldThrow&amp;lt;ExpectedExceptionType&amp;gt;();&lt;/pre&gt;
&lt;p&gt;You can try to inline the call, but it ends up pretty ugly once all the necessary casting is said and done.:&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;((Action)(() =&amp;gt; ThrowingMethod())).ShouldThrow&amp;lt;ExpectedExceptionType&amp;gt;();&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;There's not really much to do about it&amp;nbsp;that I can think of, other than to try to leave it in the two-line form. I'm not even sure where to start with creating a fluent version of this, but may give it a look when I get back home from CodeMash.&lt;/p&gt;
&lt;/div&gt;</description><author>MelGrubb</author><pubDate>Fri, 14 Jan 2011 18:32:32 GMT</pubDate><guid isPermaLink="false">New Post: ShouldBeThrownBy 20110114063232P</guid></item><item><title>New Post: ShouldBeThrownBy</title><link>http://should.codeplex.com/Thread/View.aspx?ThreadId=239412</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Mel &amp;amp; Eric,&lt;/p&gt;
&lt;p&gt;I came up with something similar - I wrote some extension methods to support the syntax of the fluent portion of the library. My sample looks nearly the same as yours, however, I didn't use the ThrowsDelegate, in it's place I dropped an 'Action' delegate.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;[Fact]
&lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; IndexOfNullArray()
{
      &lt;span style="color:blue"&gt;string&lt;/span&gt;[] values = &lt;span style="color:blue"&gt;null&lt;/span&gt;;
      Action action = () =&amp;gt; values.IndexOf(&lt;span style="color:#a31515"&gt;&amp;quot;find me&amp;quot;&lt;/span&gt;);
      action.Should().Be.Throwing&amp;lt;ArgumentNullException&amp;gt;();
}

&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Note that I also went with the '-ing' form of Throw&amp;lt;&amp;gt; as it seems to read cleaner when using the 'Be' part. Otherwise it would read: Should.Throw&amp;lt;ArgumentNullException&amp;gt;().&lt;/p&gt;
&lt;p&gt;John&lt;/p&gt;
&lt;/div&gt;</description><author>CodeMonkeyKing</author><pubDate>Wed, 29 Dec 2010 07:21:01 GMT</pubDate><guid isPermaLink="false">New Post: ShouldBeThrownBy 20101229072101A</guid></item><item><title>New Post: ShouldBeThrownBy</title><link>http://should.codeplex.com/Thread/View.aspx?ThreadId=239412</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;I will take a look at it on thursday. I do not have access to a compiler before then.&lt;/p&gt;
&lt;p&gt;sent from my mobile&lt;/p&gt;
&lt;div&gt;On Dec 27, 2010 11:30 PM, &amp;quot;MelGrubb&amp;quot; &amp;lt;&lt;a href="mailto:notifications@codeplex.com"&gt;notifications@codeplex.com&lt;/a&gt;&amp;gt; wrote:&lt;br type="attribution"&gt;
&amp;gt; From: MelGrubb&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I did some experimenting tonight, and while it's easy enough to define an extension against ThrowsDelegate...public static void ShouldThrow&amp;lt;T&amp;gt;(this Assert.ThrowsDelegate @delegate) where T : Exception{ Assert.Throws&amp;lt;T&amp;gt;(@delegate);}...the syntax for actually
 using it is less than awesome.Assert.ThrowsDelegate @delegate = () =&amp;gt; ThrowMethod();@delegate.ShouldThrow&amp;lt;ArgumentException&amp;gt;();// Or as a single line((Assert.ThrowsDelegate)(() =&amp;gt; ThrowMethod())).ShouldThrow&amp;lt;ArgumentException&amp;gt;();I just can't seem to make the
 syntax any better than this. Maybe someone with better delegate/expression/lambda-fu can jump in and show me a better way, but this is all I have been able to come up with so far. I could be overlooking something obvious. Anyone?
&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;/div&gt;
&lt;/div&gt;</description><author>erichexter</author><pubDate>Tue, 28 Dec 2010 11:46:27 GMT</pubDate><guid isPermaLink="false">New Post: ShouldBeThrownBy 20101228114627A</guid></item><item><title>New Post: ShouldBeThrownBy</title><link>http://should.codeplex.com/Thread/View.aspx?ThreadId=239412</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;sent from my mobile&lt;/p&gt;
&lt;div&gt;On Dec 27, 2010 11:30 PM, &amp;quot;MelGrubb&amp;quot; &amp;lt;&lt;a href="mailto:notifications@codeplex.com"&gt;notifications@codeplex.com&lt;/a&gt;&amp;gt; wrote:&lt;br type="attribution"&gt;
&amp;gt; From: MelGrubb&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I did some experimenting tonight, and while it's easy enough to define an extension against ThrowsDelegate...public static void ShouldThrow&amp;lt;T&amp;gt;(this Assert.ThrowsDelegate @delegate) where T : Exception{ Assert.Throws&amp;lt;T&amp;gt;(@delegate);}...the syntax for actually
 using it is less than awesome.Assert.ThrowsDelegate @delegate = () =&amp;gt; ThrowMethod();@delegate.ShouldThrow&amp;lt;ArgumentException&amp;gt;();// Or as a single line((Assert.ThrowsDelegate)(() =&amp;gt; ThrowMethod())).ShouldThrow&amp;lt;ArgumentException&amp;gt;();I just can't seem to make the
 syntax any better than this. Maybe someone with better delegate/expression/lambda-fu can jump in and show me a better way, but this is all I have been able to come up with so far. I could be overlooking something obvious. Anyone?
&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;/div&gt;
&lt;/div&gt;</description><author>erichexter</author><pubDate>Tue, 28 Dec 2010 11:45:07 GMT</pubDate><guid isPermaLink="false">New Post: ShouldBeThrownBy 20101228114507A</guid></item></channel></rss>