<?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: TDD of a WinForm app &#8211; Part 1 &#8211; Searching for Accounts</title>
	<atom:link href="http://blog.coryfoy.com/2007/10/tdd-of-a-winform-app-part-1-searching-for-accounts/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.coryfoy.com/2007/10/tdd-of-a-winform-app-part-1-searching-for-accounts/</link>
	<description>It&#039;s all about delivering</description>
	<lastBuildDate>Wed, 08 Feb 2012 16:42:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Avi Naparstek</title>
		<link>http://blog.coryfoy.com/2007/10/tdd-of-a-winform-app-part-1-searching-for-accounts/comment-page-1/#comment-110</link>
		<dc:creator>Avi Naparstek</dc:creator>
		<pubDate>Sun, 04 Nov 2007 08:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cornetdesign.com/?p=110#comment-110</guid>
		<description>Hi Cory - Nice post, I enjoyed reading it.&lt;br /&gt;2 points to notice:&lt;br /&gt;&lt;br /&gt;1. You might be able to get rid of the searchCriteria member by using inline anonymous delegates, like this:&lt;br /&gt;&lt;br /&gt;public Accounts FindAccounts(string criteria)&lt;br /&gt;{&lt;br /&gt; Accounts foundAccounts = new Accounts(this.FindAll(delegate(Account account)&lt;br /&gt; {&lt;br /&gt;  return MatchesFullNameOrPhone(account, criteria);&lt;br /&gt; }&lt;br /&gt;));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private bool MatchesFullNameOrPhone(Account account, string searchCriteria)&lt;br /&gt;{&lt;br /&gt; return account.Name.Contains(searchCriteria)&lt;br /&gt;  &#124;&#124; account.PhoneNumber.Contains(searchCriteria);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;2. I&#039;ve found a nice source-code formatter for blogger - you might want to use it (no offense intended :-)&lt;br /&gt; http://formatmysourcecode.blogspot.com/&lt;br /&gt;&lt;br /&gt;All the best,&lt;br /&gt; - Avi</description>
		<content:encoded><![CDATA[<p>Hi Cory &#8211; Nice post, I enjoyed reading it.<br />2 points to notice:</p>
<p>1. You might be able to get rid of the searchCriteria member by using inline anonymous delegates, like this:</p>
<p>public Accounts FindAccounts(string criteria)<br />{<br /> Accounts foundAccounts = new Accounts(this.FindAll(delegate(Account account)<br /> {<br />  return MatchesFullNameOrPhone(account, criteria);<br /> }<br />));<br />}</p>
<p>private bool MatchesFullNameOrPhone(Account account, string searchCriteria)<br />{<br /> return account.Name.Contains(searchCriteria)<br />  || account.PhoneNumber.Contains(searchCriteria);<br />}</p>
<p>2. I&#8217;ve found a nice source-code formatter for blogger &#8211; you might want to use it (no offense intended :-)<br /> <a href="http://formatmysourcecode.blogspot.com/" rel="nofollow">http://formatmysourcecode.blogspot.com/</a></p>
<p>All the best,<br /> &#8211; Avi</p>
]]></content:encoded>
	</item>
</channel>
</rss>

