<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tim Scott&#039;s Blog</title>
	<atom:link href="http://lunaverse.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://lunaverse.wordpress.com</link>
	<description>A Blog About .NET Software Development</description>
	<lastBuildDate>Tue, 31 Jan 2012 23:09:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='lunaverse.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Tim Scott&#039;s Blog</title>
		<link>http://lunaverse.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://lunaverse.wordpress.com/osd.xml" title="Tim Scott&#039;s Blog" />
	<atom:link rel='hub' href='http://lunaverse.wordpress.com/?pushpress=hub'/>
		<item>
		<title>FluentHtml Gets HTML 5 Support</title>
		<link>http://lunaverse.wordpress.com/2011/08/16/fluenthtml-gets-html-5-support/</link>
		<comments>http://lunaverse.wordpress.com/2011/08/16/fluenthtml-gets-html-5-support/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 23:20:05 +0000</pubDate>
		<dc:creator>Tim Scott</dc:creator>
				<category><![CDATA[FluentHtml]]></category>
		<category><![CDATA[MS MVC]]></category>

		<guid isPermaLink="false">http://lunaverse.wordpress.com/?p=1205</guid>
		<description><![CDATA[We have added HTML5 support to FluentHtml in the MvcContrib project.  Specifically, we added support for most of the new input types, input attributes and the new datalist element.  Now you can do like so: @this.DataList("countriesList").Options(countries) @this.TextBox(x =&#62; x.Countries).List("countriesList").Autofocus() @this.SearchBox(x =&#62; x.Term).Placeholder("Enter search terms").Novalidate(shouldValidate) @this.DatePicker(x =&#62; x.CompletedDate).Required(true).Limit(minDate, maxDate) //min, max @this.TimePicker(x =&#62; x.StartTime).Limit(TimeSpan.FromHours(10), TimeSpan.FromHours(14), 60) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=1205&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We have added HTML5 support to FluentHtml in the <a href="http://mvccontrib.codeplex.com/">MvcContrib</a> project.  Specifically, we added support for most of the new input types, input attributes and the new datalist element.  Now you can do like so:</p>
<div class="csharpcode">
<pre class="csharpcode">@<span class="kwrd">this</span>.DataList(<span class="str">"countriesList"</span>).Options(countries)
@<span class="kwrd">this</span>.TextBox(x =&gt; x.Countries).List(<span class="str">"countriesList"</span>).Autofocus()
@<span class="kwrd">this</span>.SearchBox(x =&gt; x.Term).Placeholder(<span class="str">"Enter search terms"</span>).Novalidate(shouldValidate)
@<span class="kwrd">this</span>.DatePicker(x =&gt; x.CompletedDate).Required(<span class="kwrd">true</span>).Limit(minDate, maxDate) <span class="rem">//min, max</span>
@<span class="kwrd">this</span>.TimePicker(x =&gt; x.StartTime).Limit(TimeSpan.FromHours(10), TimeSpan.FromHours(14), 60) <span class="rem">//min, max, step</span>
@<span class="kwrd">this</span>.NumberBox(x =&gt; x.CompletedDate).Limit(0, 100, 10) <span class="rem">//min, max, step</span>
@<span class="kwrd">this</span>.EmailBox(x =&gt; x.Email).Multiple(<span class="kwrd">true</span>).Autocomplete(<span class="kwrd">false</span>)
@<span class="kwrd">this</span>.SubmitButton(<span class="str">"Submit"</span>).TargetBlank()</pre>
</div>
<p>The above is just an example.  There&#8217;s a lot more too.  You know of course that a lot of this stuff is <a href="http://en.wikipedia.org/wiki/Comparison_of_layout_engines_(HTML5)#Form_elements_and_attributes">not yet supported by many browsers</a>.  But it&#8217;s coming, and we wanted to be ready.  It might be some time before this is in the NuGet distro, but you can build the trunk and try it out now.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lunaverse.wordpress.com/1205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lunaverse.wordpress.com/1205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lunaverse.wordpress.com/1205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lunaverse.wordpress.com/1205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lunaverse.wordpress.com/1205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lunaverse.wordpress.com/1205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lunaverse.wordpress.com/1205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lunaverse.wordpress.com/1205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lunaverse.wordpress.com/1205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lunaverse.wordpress.com/1205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lunaverse.wordpress.com/1205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lunaverse.wordpress.com/1205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lunaverse.wordpress.com/1205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lunaverse.wordpress.com/1205/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=1205&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lunaverse.wordpress.com/2011/08/16/fluenthtml-gets-html-5-support/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bb15b284510700d32de5a68f190c6dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tim</media:title>
		</media:content>
	</item>
		<item>
		<title>MvcContrib.FluentHtml on NuGet</title>
		<link>http://lunaverse.wordpress.com/2010/12/31/mvccontrib-fluenthtml-on-nuget/</link>
		<comments>http://lunaverse.wordpress.com/2010/12/31/mvccontrib-fluenthtml-on-nuget/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 14:55:14 +0000</pubDate>
		<dc:creator>Tim Scott</dc:creator>
				<category><![CDATA[FluentHtml]]></category>
		<category><![CDATA[MS MVC]]></category>

		<guid isPermaLink="false">http://lunaverse.wordpress.com/?p=1180</guid>
		<description><![CDATA[Okay, I&#8217;m a little slow getting this out.  MvcContrib.FluentHtml is now available via NuGet.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=1180&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Okay, I&#8217;m a little slow getting this out.  <a href="http://mvccontrib.codeplex.com/">MvcContrib</a>.<a href="http://lunaverse.wordpress.com/2008/12/13/mvcfluenthtml-moved-to-mvccontrib/">FluentHtml</a> is now available via <a href="http://nuget.codeplex.com/">NuGet</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lunaverse.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lunaverse.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lunaverse.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lunaverse.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lunaverse.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lunaverse.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lunaverse.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lunaverse.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lunaverse.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lunaverse.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lunaverse.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lunaverse.wordpress.com/1180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lunaverse.wordpress.com/1180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lunaverse.wordpress.com/1180/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=1180&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lunaverse.wordpress.com/2010/12/31/mvccontrib-fluenthtml-on-nuget/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bb15b284510700d32de5a68f190c6dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tim</media:title>
		</media:content>
	</item>
		<item>
		<title>MvcContrib.FluentHtml With Razor</title>
		<link>http://lunaverse.wordpress.com/2010/12/12/mvccontrib-fluenthtml-with-razor/</link>
		<comments>http://lunaverse.wordpress.com/2010/12/12/mvccontrib-fluenthtml-with-razor/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 19:44:08 +0000</pubDate>
		<dc:creator>Tim Scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lunaverse.wordpress.com/?p=1185</guid>
		<description><![CDATA[MvcContrib.FluentHtml works with the Razor view engine.  To use it now, you have two choices.  You can build from the trunk, or copy this class into your MVC 3 web app.  Then put the following line in your markup file (with your view&#8217;s model as the generic parameter): @inherits MvcContrib.FluentHtml.ModelWebViewPage&#60;MyApp.WebUI.Models.MyModel&#62; If you decided to put [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=1185&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://mvccontrib.codeplex.com/">MvcContrib</a>.<a href="http://lunaverse.wordpress.com/2008/12/13/mvcfluenthtml-moved-to-mvccontrib/">FluentHtml</a> works with the Razor view engine.  To use it now, you have two choices.  You can build from the trunk, or copy <a href="http://mvccontrib.codeplex.com/SourceControl/changeset/view/49cd9d3cb038#src%2fMvcContrib.FluentHtml%2fModelWebViewPage.cs">this class</a> into your MVC 3 web app.  Then put the following line in your markup file (with your view&#8217;s model as the generic parameter):</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">@inherits MvcContrib.FluentHtml.ModelWebViewPage<span class="kwrd">&lt;</span><span class="html">MyApp.WebUI.Models.MyModel</span><span class="kwrd">&gt;</span></pre>
<p>If you decided to put the ModelWebViewPage class into your app directly, of course, adjust the namespace accordingly.  You should also remove any @model directive because the @inherits directive tells the view what the model is.</p>
<p>You probably also want to add this to the namespaces section of your Views web.config file (not the app level web.config):</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">add</span> <span class="attr">namespace</span><span class="kwrd">="MvcContrib.FluentHtml"</span><span class="kwrd">/&gt;</span></pre>
<p>Use the fluent helpers just like you would in an aspx file, except with Razor syntax of course.  For example:<br />
<!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">@<span class="kwrd">this</span>.TextBox(x =&gt; x.FirstName).Id(<span class="str">"firstName"</span>).Class(<span class="str">"someClass"</span>).AutoLabel()</pre>
<p>Enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lunaverse.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lunaverse.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lunaverse.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lunaverse.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lunaverse.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lunaverse.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lunaverse.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lunaverse.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lunaverse.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lunaverse.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lunaverse.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lunaverse.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lunaverse.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lunaverse.wordpress.com/1185/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=1185&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lunaverse.wordpress.com/2010/12/12/mvccontrib-fluenthtml-with-razor/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bb15b284510700d32de5a68f190c6dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tim</media:title>
		</media:content>
	</item>
		<item>
		<title>Better Do: My Second iPhone App</title>
		<link>http://lunaverse.wordpress.com/2010/10/29/better-do-my-second-iphone-app-available/</link>
		<comments>http://lunaverse.wordpress.com/2010/10/29/better-do-my-second-iphone-app-available/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 23:45:12 +0000</pubDate>
		<dc:creator>Tim Scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lunaverse.wordpress.com/?p=1132</guid>
		<description><![CDATA[WARNING: Shameless commercial promotion below. Last spring I revealed my alter-ego as an iPhone app developer when I announced my first iPhone app, Bill It.  Today I am proud to announce that my second iPhone app, Better Do, is for sale in the App Store.  It&#8217;s free.  There are ads, which can be turned off [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=1132&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>WARNING: Shameless commercial promotion below.</p>
<p><a href="http://lunaverse.files.wordpress.com/2010/10/icon-721.png"><img class="alignnone size-full wp-image-1136" title="Icon-72" src="http://lunaverse.files.wordpress.com/2010/10/icon-721.png?w=600" alt="Better Do logo"   /></a></p>
<p>Last spring I revealed my alter-ego as an iPhone app developer when I announced my first iPhone app, <a href="../2010/04/23/bill-it-iphone-app-time-entry-on-the-go-quickbooks-integration">Bill It</a>.  Today I am proud to announce that my second iPhone app, Better Do, is <a href="http://itunes.apple.com/us/app/better-do/id391311116?mt=8">for sale in the App Store</a>.  It&#8217;s free.  There are ads, which can be turned off for a low price.</p>
<p>Better Do is a To Do list app.  Yeah, I know, another To Do list app?  Aren&#8217;t there hundreds of those?  Indeed there are.  But none of them work for me.  There are generally two types of To Do list apps: too-snazzy and too-simple.  The first type promises to totally manage all of your tasks as long as your enter a whole bunch of information, including a fixed due date for each.  The second type is a basic list, maybe with categories, and maybe it lets you re-order tasks.</p>
<p>Better Do assumes that tasks fall into typical time-frames.  When you think of a task, you want to write it down before you forget.  At that moment you don&#8217;t care about setting an exact due date, but you do have an idea of the time-frame:</p>
<ul>
<li>Today (Go to post office, Reply to Jim)</li>
<li>Tonight (Call mom, Take out the trash)</li>
<li>This Weekend (Fix the fence, Holiday shopping)</li>
<li>Some Day (Learn Japanese)</li>
</ul>
<p>At the start of a day you might want to review all your tasks and move certain items to Today.  But if you&#8217;re like me, as the day unfolds you realize that maybe you were a little&#8230;ambitious.  You decide to push certain things.  Now you don&#8217;t want those deferred tasks staring you in the face all day, do you?  No problem.  Move them to:</p>
<ul>
<li>Tomorrow</li>
<li>This Week</li>
<li>Next Week</li>
</ul>
<p>My favorite thing about Better Do is that it&#8217;s very easy to move, sort and generally mange your tasks with minimal taps.</p>
<p>Give it a try, and please rate it or review it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lunaverse.wordpress.com/1132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lunaverse.wordpress.com/1132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lunaverse.wordpress.com/1132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lunaverse.wordpress.com/1132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lunaverse.wordpress.com/1132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lunaverse.wordpress.com/1132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lunaverse.wordpress.com/1132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lunaverse.wordpress.com/1132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lunaverse.wordpress.com/1132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lunaverse.wordpress.com/1132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lunaverse.wordpress.com/1132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lunaverse.wordpress.com/1132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lunaverse.wordpress.com/1132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lunaverse.wordpress.com/1132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=1132&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lunaverse.wordpress.com/2010/10/29/better-do-my-second-iphone-app-available/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bb15b284510700d32de5a68f190c6dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tim</media:title>
		</media:content>

		<media:content url="http://lunaverse.files.wordpress.com/2010/10/icon-721.png" medium="image">
			<media:title type="html">Icon-72</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting Started With Should Assertion Library</title>
		<link>http://lunaverse.wordpress.com/2010/10/08/getting-started-with-should-assertion-library/</link>
		<comments>http://lunaverse.wordpress.com/2010/10/08/getting-started-with-should-assertion-library/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 19:04:44 +0000</pubDate>
		<dc:creator>Tim Scott</dc:creator>
				<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://lunaverse.wordpress.com/?p=1037</guid>
		<description><![CDATA[What Is It? Should Assertion Library (&#8220;Should&#8221; for short) is a library of test assertion methods for .NET.  It is totally independent of, and completely compatible with any testing framework.  It was created by Eric Hexter, and I subsequently added a fluent interface which I ported from ShouldIt.  ShouldIt is now deprecated. Should comes in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=1037&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>What Is It?</h2>
<p><a href="http://should.codeplex.com/">Should Assertion Library</a> (&#8220;Should&#8221; for short) is a library of test assertion methods for .NET.  It is totally independent of, and completely compatible with any testing framework.  It was created by <a href="http://www.lostechies.com/blogs/hex/default.aspx">Eric Hexter</a>, and I subsequently added a fluent interface which I ported from ShouldIt.  ShouldIt is <a href="http://lunaverse.wordpress.com/2010/10/08/goodbye-shouldit-hello-should-assertion-library/">now deprecated</a>.</p>
<p>Should comes in two flavors:</p>
<ul>
<li>normal (Should.dll)</li>
<li>fluent (Should.Fluent.dll).</li>
</ul>
<h2>Get It</h2>
<p>You can get the latest binaries from <a href="http://nupack.codeplex.com/">NuPack</a> or the <a href="http://should.codeplex.com/releases/view/45655">project site</a>.</p>
<p>By the way, if you haven&#8217;t tried NuPack yet, go get it right now!  You&#8217;ve got it?  Okay, open the Package Management Console and enter:</p>
<pre class="csharpcode">&gt; Install-Package Should</pre>
<p>or</p>
<pre class="csharpcode">&gt; Install-Package ShouldFluent</pre>
<p>This will install Should as a package in the current solution.  You probably want to use either the fluent API or the normal API in any given test project – but not both.  Choosing one or the other will promote a consistent practice within your team.  Obviously, <a href="http://lunaverse.wordpress.com/2009/07/17/740/">I prefer the fluent API</a>.</p>
<h2>Use It</h2>
<p>There&#8217;s not much to say about usage.  It&#8217;s really pretty intuitive and discoverable.  Just start typing &#8220;.Should&#8221; after your actual object, and you will see what&#8217;s available.  To give you a taste, here&#8217;s a simple example:</p>
<div class="csharpcode">
<pre class="csharpcode">actual.ShouldNotBeNull();
actual.ShouldBeType&lt;<span class="kwrd">Foo</span>&gt;();
actual.ShouldBeSameAs(expected);</pre>
</div>
<p>Or fluently:</p>
<div class="csharpcode">
<pre class="csharpcode">actual
    .Should().Not.Be.Null()
    .Should().Be.OfType&lt;<span class="kwrd">Foo</span>&gt;()
    .Should().Be.SameAs(expected);</pre>
</div>
<p>There are several examples of both the normal and the fluent syntax <a href="http://should.codeplex.com/">here</a>.</p>
<p>Enjoy!</p>
<p><em><strong>A Note To ShouldIt Users</strong>: If you have been using ShouldIt, just remove the ShouldIt DLLs, add Should.Fluent.dll, and change the namespaces.  Everything should just work.  Of course depending on which test framework you were using with ShouldIt, the underlying assertion behavior could change slightly.  It should be pretty easy to spot the differences and make any small corrections as needed.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lunaverse.wordpress.com/1037/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lunaverse.wordpress.com/1037/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lunaverse.wordpress.com/1037/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lunaverse.wordpress.com/1037/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lunaverse.wordpress.com/1037/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lunaverse.wordpress.com/1037/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lunaverse.wordpress.com/1037/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lunaverse.wordpress.com/1037/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lunaverse.wordpress.com/1037/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lunaverse.wordpress.com/1037/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lunaverse.wordpress.com/1037/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lunaverse.wordpress.com/1037/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lunaverse.wordpress.com/1037/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lunaverse.wordpress.com/1037/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=1037&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lunaverse.wordpress.com/2010/10/08/getting-started-with-should-assertion-library/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bb15b284510700d32de5a68f190c6dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tim</media:title>
		</media:content>
	</item>
		<item>
		<title>Goodbye ShouldIt, Hello Should Assertion Library</title>
		<link>http://lunaverse.wordpress.com/2010/10/08/goodbye-shouldit-hello-should-assertion-library/</link>
		<comments>http://lunaverse.wordpress.com/2010/10/08/goodbye-shouldit-hello-should-assertion-library/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 19:00:46 +0000</pubDate>
		<dc:creator>Tim Scott</dc:creator>
				<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://lunaverse.wordpress.com/?p=983</guid>
		<description><![CDATA[First There Was ShouldIt Almost a year and a half ago I created ShouldIt.   Soon after I added a fluent API.  My goal was to create a test assertion library that would be portable across all major test frameworks.  This would allow me to move from project to project using the same nice test [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=983&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>First There Was ShouldIt</h2>
<p>Almost a year and a half ago I created <a href="http://lunaverse.wordpress.com/2009/05/31/rusable-should-extensions/">ShouldIt</a>.   Soon after I added a <a href="http://lunaverse.wordpress.com/2009/07/17/740/">fluent API</a>.  My goal was to create a test assertion library that would be portable across all major test frameworks.  This would allow me to move from project to project using the same nice test assertions without the sick feeling I was getting from copy-paste reuse.  So I created the API, sprinkled in a little <a href="http://mef.codeplex.com/">MEF</a>, stirred, and ShouldIt was born.  It felt really good.</p>
<p>My joy was dampened however by one nagging issue.  Although ShouldIt plugged nicely into any framework I might ever use, it carried with it a binary dependency to some particular version of each testing framework.  This made it really hard to distribute, and thus hard to achieve any kind of adoption.  This is probably why <a href="http://www.lostechies.com/blogs/hex/default.aspx">Eric Hexter</a> yawned when I told him about ShouldIt.  He went looking for a better way.</p>
<h2>Then Came Should</h2>
<p>Recently he found it, and created <a href="http://should.codeplex.com/">Should Assertion Library</a> (or &#8220;Should&#8221; for short) .  Whereas ShouldIt leveraged the assertion machinery of whatever test runner you might be using, Eric created a library with it&#8217;s own machinery, thus completely breaking any dependence on a testing framework.  On a side note, I had briefly considered doing this myself with ShouldIt.  I was cured of this notion by perusing the assertion source code in NUnit.  It is, uh, non-trivial.  So how did Eric pull it off?  Is he a more talented and dedicated programmer than I am?  Probably yes, but he did not create it either.  Rather, he forked the assertion machinery of <a href="http://xunit.codeplex.com/">xUnit</a> (with the blessings of the xUnit folks).  Brilliant!</p>
<h2>They Get Married</h2>
<p>When I saw Should Assertion Library I knew immediately that this was the way to go.  My only complaint was that ItUsedVeryLongPascalCaseNamedAssertionMethods.  Okay, you either love the fluent style of assertions or you hate it.  I <a href="http://lunaverse.wordpress.com/2009/07/17/740/">love it</a>, and I refuse to go back.  So I decided to see how hard it would be to port ShouldIt&#8217;s fluent API bits into Eric&#8217;s project.  It turned out to be very easy, so I suggested to Eric that Should Assertion Library might support two styles: fluent and long name.  He agreed, and very soon the Should.Fluent assembly was created.</p>
<p>More: <a href="http://lunaverse.wordpress.com/2010/10/08/getting-started-with-should-assertion-library/">Getting Started With Should Assertion Library</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lunaverse.wordpress.com/983/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lunaverse.wordpress.com/983/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lunaverse.wordpress.com/983/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lunaverse.wordpress.com/983/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lunaverse.wordpress.com/983/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lunaverse.wordpress.com/983/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lunaverse.wordpress.com/983/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lunaverse.wordpress.com/983/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lunaverse.wordpress.com/983/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lunaverse.wordpress.com/983/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lunaverse.wordpress.com/983/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lunaverse.wordpress.com/983/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lunaverse.wordpress.com/983/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lunaverse.wordpress.com/983/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=983&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lunaverse.wordpress.com/2010/10/08/goodbye-shouldit-hello-should-assertion-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bb15b284510700d32de5a68f190c6dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tim</media:title>
		</media:content>
	</item>
		<item>
		<title>BDD With MSpec Presentation &#8211; Code and Slides Posted</title>
		<link>http://lunaverse.wordpress.com/2010/05/30/bdd-with-mspec-presentation-code-and-slides-posted/</link>
		<comments>http://lunaverse.wordpress.com/2010/05/30/bdd-with-mspec-presentation-code-and-slides-posted/#comments</comments>
		<pubDate>Sun, 30 May 2010 17:16:34 +0000</pubDate>
		<dc:creator>Tim Scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lunaverse.wordpress.com/?p=972</guid>
		<description><![CDATA[Jeff Lyon and I presented BDD With MSpec at Austin Code Camp earlier this month.  Finally I got around to posting the code and slides here.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=972&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Jeff Lyon and I presented <em><strong>BDD With MSpec</strong> </em>at <a href="http://codecamp.adnug.org/">Austin Code Camp</a> earlier this month.  Finally I got around to posting the code and slides <a href="http://code.google.com/p/austin-codecamp-2010/downloads/list?saved=1&amp;ts=1275239335">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lunaverse.wordpress.com/972/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lunaverse.wordpress.com/972/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lunaverse.wordpress.com/972/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lunaverse.wordpress.com/972/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lunaverse.wordpress.com/972/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lunaverse.wordpress.com/972/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lunaverse.wordpress.com/972/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lunaverse.wordpress.com/972/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lunaverse.wordpress.com/972/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lunaverse.wordpress.com/972/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lunaverse.wordpress.com/972/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lunaverse.wordpress.com/972/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lunaverse.wordpress.com/972/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lunaverse.wordpress.com/972/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=972&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lunaverse.wordpress.com/2010/05/30/bdd-with-mspec-presentation-code-and-slides-posted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bb15b284510700d32de5a68f190c6dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tim</media:title>
		</media:content>
	</item>
		<item>
		<title>Bill It &#8211; IPhone App &#8211; Time Entry On The Go, QuickBooks Integration</title>
		<link>http://lunaverse.wordpress.com/2010/04/23/bill-it-iphone-app-time-entry-on-the-go-quickbooks-integration/</link>
		<comments>http://lunaverse.wordpress.com/2010/04/23/bill-it-iphone-app-time-entry-on-the-go-quickbooks-integration/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 05:18:01 +0000</pubDate>
		<dc:creator>Tim Scott</dc:creator>
				<category><![CDATA[MonoTouch]]></category>

		<guid isPermaLink="false">http://lunaverse.wordpress.com/?p=945</guid>
		<description><![CDATA[Warning: this post is a shameless commercial promotion. I have a secret. I have been working on an IPhone app. I am proud to announce that it&#8217;s finished and for sale in the App Store. Current price: $4.99. It&#8217;s called Bill It. The Problem I created Bill It because I needed it myself. I am [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=945&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Warning: this post is a shameless commercial promotion.</p>
<p>I have a secret.  I have been working on an IPhone app.  I am proud to announce that it&#8217;s finished and for sale in the App Store.  Current price: $4.99.  It&#8217;s called <a title="Bill It" href="http://itunes.apple.com/us/app/bill-it/id366742329?mt=8" target="_blank">Bill It</a>.</p>
<p><a href="http://itunes.apple.com/us/app/bill-it/id366742329?mt=8"><img class="alignnone size-full wp-image-946" title="BillItAppStore" src="http://lunaverse.files.wordpress.com/2010/04/billitappstore-e1271998941506.png?w=600" alt=""   /></a></p>
<h2>The Problem</h2>
<p>I created Bill It because I needed it myself.  I am a consultant, and I use QuickBooks to bill my clients.  The edition  of QuickBooks that I use comes with a nice time entry feature that makes it pretty easy to bill my clients based on time and materials.  But it&#8217;s inconvenient to open QuickBooks whenever I want to record my time.  But if I wait, I forget, and that&#8217;s bad.  I have used various mobile apps to capture my time &#8212; first on a Palm device, then on my IPhone.  But this presents a different problem: double entry.  It&#8217;s a hassle to transcribe hours from one screen to another, but the real problem is accuracy.  Each transcription carries with it a small risk of error.  Billing errors are bad.</p>
<h2>The Solution</h2>
<p>So I created Bill It.  Bill It lets me enter my time on the go with no friction.  The time is accurate because I enter it when it&#8217;s fresh in my mind.  When billing time rolls around, it&#8217;s a couple of taps to send myself an email with a file attached.  I open QuickBooks, and with a few clicks the time is imported.  No fear of errors, and very little hassle.</p>
<h2>Bill It Lite</h2>
<p>A pet peeve of mine is paying for an app that I will never use.  Even if it&#8217;s only a buck.  On the other hand I don&#8217;t mind paying a premium price for an app I will use regularly.  So I created <a title="Bill It Lite" href="http://itunes.apple.com/us/app/bill-it-lite/id367603023?mt=8" target="_blank">Bill It Lite</a>, which lets users try out every aspect of Bill It before they pay for it.  Another pet peeve is when I try out a lite version only to realize that I must redo a bunch of setup and data entry when I buy the full version.  Not with Bill It Lite.  Users can buy the full version right in the app.  No new app.  No redoing setup and data entry.</p>
<p>You might also be interested to know that I developed Bill It using <a href="http://monotouch.net/">MonoTouch</a> and <a href="http://code.google.com/p/catnap-orm/">Catnap</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lunaverse.wordpress.com/945/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lunaverse.wordpress.com/945/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lunaverse.wordpress.com/945/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lunaverse.wordpress.com/945/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lunaverse.wordpress.com/945/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lunaverse.wordpress.com/945/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lunaverse.wordpress.com/945/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lunaverse.wordpress.com/945/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lunaverse.wordpress.com/945/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lunaverse.wordpress.com/945/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lunaverse.wordpress.com/945/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lunaverse.wordpress.com/945/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lunaverse.wordpress.com/945/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lunaverse.wordpress.com/945/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=945&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lunaverse.wordpress.com/2010/04/23/bill-it-iphone-app-time-entry-on-the-go-quickbooks-integration/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bb15b284510700d32de5a68f190c6dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tim</media:title>
		</media:content>

		<media:content url="http://lunaverse.files.wordpress.com/2010/04/billitappstore-e1271998941506.png" medium="image">
			<media:title type="html">BillItAppStore</media:title>
		</media:content>
	</item>
		<item>
		<title>ShouldIt Is ILMerged</title>
		<link>http://lunaverse.wordpress.com/2010/01/10/shouldit-is-ilmerged/</link>
		<comments>http://lunaverse.wordpress.com/2010/01/10/shouldit-is-ilmerged/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 18:49:43 +0000</pubDate>
		<dc:creator>Tim Scott</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://lunaverse.wordpress.com/?p=922</guid>
		<description><![CDATA[ShouldIt is a library of fluent specification extensions that works with all of the popular testing frameworks. My goal with ShouldIt is to provide a robust set of testing extensions that I can drop in to any test project, and it just works. So far ShouldIt has met that goal, well mostly. One small friction [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=922&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/shouldit/">ShouldIt</a> is a library of <a href="http://lunaverse.wordpress.com/2009/07/17/740/">fluent </a>specification extensions that works with all of the popular testing frameworks.  My goal with ShouldIt is to provide a robust set of testing extensions that I can drop in to any test project, and it just works.</p>
<p>So far ShouldIt has met that goal, well mostly.  One small friction point is the need to reference <em><strong>four </strong></em>DLLs (not counting the testing framework itself) in my test projects.  No more.  I have added an automated build that ILMerges all the required assemblies.  And to make it easy for others to adopt ShouldIt, the <a href="http://code.google.com/p/shouldit/downloads/list">download page</a> now has a single file download for each testing framework.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lunaverse.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lunaverse.wordpress.com/922/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lunaverse.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lunaverse.wordpress.com/922/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lunaverse.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lunaverse.wordpress.com/922/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lunaverse.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lunaverse.wordpress.com/922/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lunaverse.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lunaverse.wordpress.com/922/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lunaverse.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lunaverse.wordpress.com/922/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lunaverse.wordpress.com/922/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lunaverse.wordpress.com/922/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=922&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lunaverse.wordpress.com/2010/01/10/shouldit-is-ilmerged/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bb15b284510700d32de5a68f190c6dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tim</media:title>
		</media:content>
	</item>
		<item>
		<title>A Question Of Astonishment</title>
		<link>http://lunaverse.wordpress.com/2009/11/30/a-question-of-astonishment/</link>
		<comments>http://lunaverse.wordpress.com/2009/11/30/a-question-of-astonishment/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 17:26:30 +0000</pubDate>
		<dc:creator>Tim Scott</dc:creator>
				<category><![CDATA[FluentHtml]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lunaverse.wordpress.com/?p=878</guid>
		<description><![CDATA[Steve Michelotti recently found a very subtle bug in MvcContrib.FluentHtml.   It provides us with a rather interesting case of applying the Principle Of Least Astonishment (a.k.a. Rule Of Least Surprise). It turns out that FluentHtml&#8217;s select helper lets the user express his intent vaguely.  Consider whether this test should pass: [Test] public void when_determining_selected_values_select_should_ignore_selected_method_if_any_options_are_marked_selected() { [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=878&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://geekswithblogs.net/michelotti/Default.aspx">Steve Michelotti</a> recently found <a href="http://geekswithblogs.net/michelotti/archive/2009/10/22/setting-selected-item-in-fluenthtml-select-list.aspx#491607">a very subtle bug</a> in <a href="http://www.codeplex.com/MVCContrib">MvcContrib</a>.<a href="http://mvccontrib.codeplex.com/wikipage?title=FluentHtml&amp;referringTitle=Documentation">FluentHtml</a>.   It provides us with a rather interesting case of applying the <a href="http://en.wikipedia.org/wiki/Principle_of_least_astonishment">Principle Of Least Astonishment</a> (a.k.a. Rule Of Least Surprise).</p>
<p>It turns out that FluentHtml&#8217;s select helper lets the user express his intent vaguely.  Consider whether this test should pass:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<div class="csharpcode">
<pre class="csharpcode">[Test]
<span class="kwrd">public</span> <span class="kwrd">void</span> when_determining_selected_values_select_should_ignore_selected_method_if_any_options_are_marked_selected()
{
    var list = <span class="kwrd">new</span> List&lt;SelectListItem&gt;
    {
        <span class="kwrd">new</span> SelectListItem { Text = <span class="str">"Acura"</span>, Value = <span class="str">"1"</span>, Selected = <span class="kwrd">true</span> },
        <span class="kwrd">new</span> SelectListItem { Text = <span class="str">"BMW"</span>, Value = <span class="str">"2"</span> },
    };

    var select = <span class="kwrd">new</span> Select(<span class="str">"foo.Bar"</span>).Selected(2).Options(list);

    var optionNodes select.ToString().ShouldHaveHtmlNode(<span class="str">"foo_Bar"</span>).ShouldHaveChildNodesCount(2);
    optionNodes[0].ShouldBeSelectedOption(1, <span class="str">"Acura"</span>);
    optionNodes[1].ShouldBeUnSelectedOption(2, <span class="str">"BMW"</span>);
}</pre>
</div>
<p>See what we have done here?  We have allowed the user to express which options should be selected in two, possibly contradictory ways.  In the call to Options, the user has specified that Acura should be selected.  In the call to Selected, she has specified that BMW should be selected.  How should we interpret what she really wants?</p>
<p>The first path to consider is to change the API to remove the chance for vaugeness. In most cases this is highly preferable. In this case, however, the cat is already out of the bag so to speak.  That is, changing the API in this way would be a big breaking change.  Furthermore, it is deliberate and I believe very useful that the API offers a lot of ways to specify select options.</p>
<p>That leaves us to invoke the Rule Of Least Surprise.  When a user specifies vague intent, in the manner that we have described, I can see five reasonable outcomes:</p>
<ol>
<li>Selected items are only those expressed via Selected</li>
<li>Selected items are only those expressed via Options</li>
<li>Selected items are a union of those expressed via Selected and Options</li>
<li>Selected items are only those expressed via Options or Selected, whichever is called last</li>
<li>Selected items are only those expressed via Options unless none, then those expressed via Selected</li>
</ol>
<p>I will reject #4 out of hand.  FluentHtml helpers are essentially builders.  And with builders, order should never be important.  #1 and #2 are the next to go.  I cannot think of a better argument for either, and so the choice would be arbitrary.  It&#8217;s a rather close call between #3 and #5, but I will choose #5.  Here is the thinking.   If the user has specified selected items within the options themselves, then calling Selected is clearly a mistake on his part and he should expect it to be ignored.  On the other hand, if he did not specify selected items within the options list, then he could reasonably expect the call to Selected to be honored.</p>
<p>Would you make a different choice?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lunaverse.wordpress.com/878/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lunaverse.wordpress.com/878/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lunaverse.wordpress.com/878/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lunaverse.wordpress.com/878/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lunaverse.wordpress.com/878/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lunaverse.wordpress.com/878/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lunaverse.wordpress.com/878/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lunaverse.wordpress.com/878/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lunaverse.wordpress.com/878/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lunaverse.wordpress.com/878/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lunaverse.wordpress.com/878/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lunaverse.wordpress.com/878/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lunaverse.wordpress.com/878/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lunaverse.wordpress.com/878/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lunaverse.wordpress.com&amp;blog=1049806&amp;post=878&amp;subd=lunaverse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lunaverse.wordpress.com/2009/11/30/a-question-of-astonishment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7bb15b284510700d32de5a68f190c6dc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">tim</media:title>
		</media:content>
	</item>
	</channel>
</rss>
