<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-15137028.post203821915504523334..comments</id><updated>2010-03-26T13:52:54.314+01:00</updated><category term='C#'/><category term='Coding Guidelines'/><category term='dotnetmag'/><category term='Visual Studio'/><category term='Fluent Assertions'/><category term='WCF RIA Services'/><category term='ALM'/><category term='Architecture'/><category term='Agile'/><category term='WCF'/><category term='CQRS'/><category term='DevDays09'/><category term='Cookbook'/><category term='TFS'/><category term='DevDays10'/><category term='ALM Practices'/><category term='Events'/><category term='Silverlight'/><category term='InRetrospect'/><category term='Testing'/><category term='Quality'/><title type='text'>Comments on Dennis Doomen.NET: The curious case of the unsolved extension methods...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.dennisdoomen.net/feeds/203821915504523334/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15137028/203821915504523334/comments/default'/><link rel='alternate' type='text/html' href='http://www.dennisdoomen.net/2010/03/curious-case-of-unsolved-extension.html'/><author><name>Dennis Doomen</name><uri>http://www.blogger.com/profile/04363006875303293621</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp1.blogger.com/_sv2gnsft17w/R75sgsYv9gI/AAAAAAAABHY/ezDFaHgAteA/S220/Dennis.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-15137028.post-5193072718230346784</id><published>2010-03-26T13:52:54.308+01:00</published><updated>2010-03-26T13:52:54.308+01:00</updated><title type='text'>I forgot about the &amp;quot;(string s) =&amp;gt; s&amp;quot; ...</title><content type='html'>I forgot about the &amp;quot;(string s) =&amp;gt; s&amp;quot; syntax. That may be a reasonable workaround. Thanks Steven.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15137028/203821915504523334/comments/default/5193072718230346784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15137028/203821915504523334/comments/default/5193072718230346784'/><link rel='alternate' type='text/html' href='http://www.dennisdoomen.net/2010/03/curious-case-of-unsolved-extension.html?showComment=1269607974308#c5193072718230346784' title=''/><author><name>Dennis Doomen</name><uri>http://www.blogger.com/profile/04363006875303293621</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp1.blogger.com/_sv2gnsft17w/R75sgsYv9gI/AAAAAAAABHY/ezDFaHgAteA/S220/Dennis.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.dennisdoomen.net/2010/03/curious-case-of-unsolved-extension.html' ref='tag:blogger.com,1999:blog-15137028.post-203821915504523334' source='http://www.blogger.com/feeds/15137028/posts/default/203821915504523334' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2136795164'/></entry><entry><id>tag:blogger.com,1999:blog-15137028.post-3733700542621570078</id><published>2010-03-26T13:19:51.560+01:00</published><updated>2010-03-26T13:19:51.560+01:00</updated><title type='text'>Don&amp;#39;t be stubborn :-)

Conditions does all the...</title><content type='html'>Don&amp;#39;t be stubborn :-)&lt;br /&gt;&lt;br /&gt;Conditions does all these kind of tricks and is heavily based on extension methods. You can write your HaveCount method as follows:&lt;br /&gt;&lt;br /&gt;public static ShouldConstraints HaveCount(this ShouldConstraints constraints, int expectedCount) where TCollection : IEnumerable&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;With your contain, you indeed hit the limit, but you&amp;#39;ll just have to help the compiler a bit. This will work:&lt;br /&gt;&lt;br /&gt;someList.Should().Contain((string s) =&amp;gt; s.Length &amp;gt; 0);&lt;br /&gt;&lt;br /&gt;I should rename &amp;#39;Contain&amp;#39; to &amp;#39;HasAny&amp;#39; or something like that. Contains is more something you&amp;#39;d use for having a certain element, like this:&lt;br /&gt;&lt;br /&gt;public static ShouldConstraints Contains(&lt;br /&gt;    this ShouldConstraints constraints,&lt;br /&gt;    TElement element) where TCollection : IEnumerable&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Good luck.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15137028/203821915504523334/comments/default/3733700542621570078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15137028/203821915504523334/comments/default/3733700542621570078'/><link rel='alternate' type='text/html' href='http://www.dennisdoomen.net/2010/03/curious-case-of-unsolved-extension.html?showComment=1269605991560#c3733700542621570078' title=''/><author><name>Steven</name><uri>http://www.cuttingedge.it/blogs/steven/</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.dennisdoomen.net/2010/03/curious-case-of-unsolved-extension.html' ref='tag:blogger.com,1999:blog-15137028.post-203821915504523334' source='http://www.blogger.com/feeds/15137028/posts/default/203821915504523334' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1646209983'/></entry><entry><id>tag:blogger.com,1999:blog-15137028.post-4301860393988429641</id><published>2010-03-26T12:20:22.460+01:00</published><updated>2010-03-26T12:20:22.460+01:00</updated><title type='text'>Hi Steven. I don&amp;#39;t think so. The limits I&amp;#39;...</title><content type='html'>Hi Steven. I don&amp;#39;t think so. The limits I&amp;#39;m talking about are related to the resolution mechanism of extension methods. I know I can solve all of this if I let loose of the someObject.Should() syntax, but I don&amp;#39;t want to...</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15137028/203821915504523334/comments/default/4301860393988429641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15137028/203821915504523334/comments/default/4301860393988429641'/><link rel='alternate' type='text/html' href='http://www.dennisdoomen.net/2010/03/curious-case-of-unsolved-extension.html?showComment=1269602422460#c4301860393988429641' title=''/><author><name>Dennis Doomen</name><uri>http://www.blogger.com/profile/04363006875303293621</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://bp1.blogger.com/_sv2gnsft17w/R75sgsYv9gI/AAAAAAAABHY/ezDFaHgAteA/S220/Dennis.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.dennisdoomen.net/2010/03/curious-case-of-unsolved-extension.html' ref='tag:blogger.com,1999:blog-15137028.post-203821915504523334' source='http://www.blogger.com/feeds/15137028/posts/default/203821915504523334' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2136795164'/></entry><entry><id>tag:blogger.com,1999:blog-15137028.post-1945112648490773291</id><published>2010-03-26T10:15:08.585+01:00</published><updated>2010-03-26T10:15:08.585+01:00</updated><title type='text'>The things you want to do are possible. I do these...</title><content type='html'>The things you want to do are possible. I do these kinds of things with my CuttingEdge.Conditions library. Take a look at it (http://conditions.codeplex.com). I think you find a solution for your problems there.&lt;br /&gt;&lt;br /&gt;For instance, users of this library can write the following lines without any problem:&lt;br /&gt;&lt;br /&gt;void Method(System.Collections.ObjectModel.Collection ids)&lt;br /&gt;{&lt;br /&gt;    Condition.Requires(ids)&lt;br /&gt;        .IsNotEmpty()&lt;br /&gt;        .HasLength(5)&lt;br /&gt;        .DoesNotContain(666)&lt;br /&gt;        .ContainsAny(new[]&lt;br /&gt;             { 1, 2, 3, 4 });&lt;br /&gt;}</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15137028/203821915504523334/comments/default/1945112648490773291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15137028/203821915504523334/comments/default/1945112648490773291'/><link rel='alternate' type='text/html' href='http://www.dennisdoomen.net/2010/03/curious-case-of-unsolved-extension.html?showComment=1269594908585#c1945112648490773291' title=''/><author><name>Steven</name><uri>http://www.cuttingedge.it/blogs/steven</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.dennisdoomen.net/2010/03/curious-case-of-unsolved-extension.html' ref='tag:blogger.com,1999:blog-15137028.post-203821915504523334' source='http://www.blogger.com/feeds/15137028/posts/default/203821915504523334' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-105649786'/></entry></feed>
