<?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: Pimp Up Your Unit Test Assertions</title> <atom:link href="http://www.arrangeactassert.com/pimp-up-your-unit-test-assertions/feed/" rel="self" type="application/rss+xml" /><link>http://www.arrangeactassert.com/pimp-up-your-unit-test-assertions/</link> <description>Jag Reehal on Agile Development, ASP.NET MVC and all manner of good stuff</description> <lastBuildDate>Sun, 29 Jan 2012 22:29:00 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>By: Dennis Doomen</title><link>http://www.arrangeactassert.com/pimp-up-your-unit-test-assertions/#comment-99</link> <dc:creator>Dennis Doomen</dc:creator> <pubDate>Sun, 08 Aug 2010 14:29:28 +0000</pubDate> <guid
isPermaLink="false">http://www.arrangeactassert.com/?p=574#comment-99</guid> <description>Jag, in terms of intention revealing unit tests, you may like http://fluentassertions.codeplex.com. With it you can do stuff like&quot;ABCDEFGHI&quot;.Should().StartWith(&quot;AB&quot;).And.EndWith(&quot;HI&quot;).And.Contain(&quot;EF&quot;).And.HaveLength(9);
new[] { 1, 2, 3 }.Should().HaveCount(4, &quot;because we thought we put three items in the
collection&quot;))
dtoCollection.Should().Contain(dto =&gt; dto.Id != null);
collection.Should().HaveCount(c =&gt; c &gt;= 3);
dto.ShouldHave().AllPropertiesBut(d =&gt; d.Id).EqualTo(customer);
dt1.Should().BeWithin(TimeSpan.FromHours(50)).Before(dt2);
Action action = () =&gt; recipe.AddIngredient(&quot;Milk&quot;, 100, Unit.Spoon);
action
.ShouldThrow()
.WithMessage(&quot;Cannot change the unit of an existing ingredient&quot;)
.And.Violations.Should().Contain(BusinessRule.CannotChangeIngredientQuanity</description> <content:encoded><![CDATA[<p>Jag, in terms of intention revealing unit tests, you may like <a
href="http://fluentassertions.codeplex.com" rel="nofollow">http://fluentassertions.codeplex.com</a>. With it you can do stuff like</p><p>&#8220;ABCDEFGHI&#8221;.Should().StartWith(&#8220;AB&#8221;).And.EndWith(&#8220;HI&#8221;).And.Contain(&#8220;EF&#8221;).And.HaveLength(9);</p><p>new[] { 1, 2, 3 }.Should().HaveCount(4, &#8220;because we thought we put three items in the<br
/> collection&#8221;))</p><p>dtoCollection.Should().Contain(dto =&gt; dto.Id != null);</p><p>collection.Should().HaveCount(c =&gt; c &gt;= 3);</p><p>dto.ShouldHave().AllPropertiesBut(d =&gt; d.Id).EqualTo(customer);</p><p>dt1.Should().BeWithin(TimeSpan.FromHours(50)).Before(dt2);</p><p>Action action = () =&gt; recipe.AddIngredient(&#8220;Milk&#8221;, 100, Unit.Spoon);<br
/> action<br
/> .ShouldThrow()<br
/> .WithMessage(&#8220;Cannot change the unit of an existing ingredient&#8221;)<br
/> .And.Violations.Should().Contain(BusinessRule.CannotChangeIngredientQuanity</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Served from: www.arrangeactassert.com @ 2012-02-06 00:21:43 by W3 Total Cache -->
