<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atomfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="0.3" xml:lang="en-US"><title>Daniel Cazzulino's Blog</title><link rel="alternate" type="text/html" href="http://www.clariusconsulting.net/blogs/kzu/default.aspx" /><tagline type="text/html">data wants to be free, and xml is the key</tagline><id>http://www.clariusconsulting.net/blogs/kzu/default.aspx</id><author><url>http://www.clariusconsulting.net/blogs/kzu/default.aspx</url></author><generator url="http://communityserver.org" version="1.0.1.50214">Community Server</generator><modified>2009-07-25T17:43:00Z</modified><link rel="start" type="application/atom+xml" href="http://feeds.feedburner.com/DanielCazzulino" /><feedburner:info uri="danielcazzulino" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license><feedburner:emailServiceId>DanielCazzulino</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><entry><title>Software Development Productivity</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/8V1xuF-1GJg/SoftwareDevelopmentProductivity.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:209694</id><created>2010-02-08T15:15:26Z</created><content type="text/html" mode="escaped">&lt;p&gt;&lt;a href="http://blog.scottbellware.com/"&gt;Scott Bellware&lt;/a&gt; has an &lt;a href="http://blog.scottbellware.com/2010/02/to-control-and-observe-productive.html"&gt;interesting series&lt;/a&gt; of posts where he discusses how to get back to productive development teams. As usual in his writing (IMO), in a rather verbose way he brings up quite a few good points. Please go ahead and read them. He links from the first entry to the next so you can follow the flow.&lt;/p&gt; &lt;p&gt;I agree with the analysis that unnatural organizational structures kill productivity, motivation and leadership. And I believe this is one of the reasons why even big companies turn to so-called "&lt;a href="http://www.clariusconsulting.net"&gt;boutique development shops&lt;/a&gt;" (shameless plug there): by being small and very cohesive, these shops offer creativity and productivity levels that "mere big" ISVs can only dream of. &lt;/p&gt; &lt;p&gt;And it's not always only a matter of design principles, I'd add. Sometimes you need a specific area of expertise which you're better off outsourcing (i.e. Visual Studio extensibility, hardcore WCF, framework/runtime libraries, WPF/Silverlight/Blend UEX, etc.). Small shops of highly specialized professionals can save you tons of money and time. But your own dev team will certainly benefit from applying sound design principles for what matters most to your business: the business rules and logic.&lt;/p&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=209694" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=8V1xuF-1GJg:Xjeqe0Vsaes:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=8V1xuF-1GJg:Xjeqe0Vsaes:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?i=8V1xuF-1GJg:Xjeqe0Vsaes:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=8V1xuF-1GJg:Xjeqe0Vsaes:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/8V1xuF-1GJg" height="1" width="1"/&gt;</content><slash:comments>2</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=209694</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2010/02/08/SoftwareDevelopmentProductivity.aspx</feedburner:origLink></entry><entry><title>How to transform old properties to automatic properties with a simple search and replace</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/DtpkRUagN0Y/202743.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:202743</id><created>2010-01-12T12:50:08Z</created><content type="text/html" mode="escaped">
		&lt;p&gt;Say you have a (typically autogenerated) class with properties like:&lt;/p&gt;
		&lt;pre class="brush: csharp; smart-tabs: false;"&gt;public partial class Project : IExtensibleDataObject
{
    public System.Runtime.Serialization.ExtensionDataObject ExtensionData
    {
        get
        {
            return this.extensionDataField;
        }
        set
        {
            this.extensionDataField = value;
        }
    }

&lt;/pre&gt;
		&lt;p&gt;Now you can fire up the Find &amp;amp; Replace dialog in VS and enter the following "simple" expression in Find What:&lt;/p&gt;
		&lt;pre class="brush: csharp;"&gt;\n:b*\{[:b\n]*get[:b\n]*\{[.:b\n]*.*[.:b\n]*\}[.:b\n]*set[:b\n]*\{[.:b\n]*.*[.:b\n]*\}[.:b\n]*\}&lt;/pre&gt;
		&lt;p&gt;And use the following expression for the replace:&lt;/p&gt;
		&lt;pre class="brush csharp;"&gt; { get; set; } &lt;/pre&gt;
		&lt;p&gt;
				&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" alt="image" src="/images/blogs/kzu/Howtotransformoldpropertiestoautomaticpr_FAA3/image.png" /&gt;
		&lt;/p&gt;
		&lt;p&gt;Don't forget to set the Use: Regular expressions option.&lt;/p&gt;
		&lt;p&gt;Running it will get you automatic properties for the entire file (or files):&lt;/p&gt;
		&lt;pre class="brush: csharp; smart-tabs: false;"&gt;public partial class Project : IExtensibleDataObject
{
    public System.Runtime.Serialization.ExtensionDataObject ExtensionData { get; set; }

    [System.Runtime.Serialization.DataMemberAttribute()]
    public int AffiliateId { get; set; }

    [System.Runtime.Serialization.DataMemberAttribute()]
    public Galleries.Domain.Model.Category[] Categories { get; set; }
&lt;/pre&gt;
		&lt;p&gt; &lt;/p&gt;
		&lt;p&gt;Yeah, I know, that expression looks like crap ;)&lt;/p&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=202743" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=DtpkRUagN0Y:17CbHBXuiJk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=DtpkRUagN0Y:17CbHBXuiJk:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?i=DtpkRUagN0Y:17CbHBXuiJk:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=DtpkRUagN0Y:17CbHBXuiJk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/DtpkRUagN0Y" height="1" width="1"/&gt;</content><slash:comments>4</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=202743</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2010/01/12/202743.aspx</feedburner:origLink></entry><entry><title>How to get out of the GAC all the registered assemblies</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/4OxSM7veTUY/HowtogetoutoftheGACalltheregisteredassemblies.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:201121</id><created>2010-01-08T07:06:42Z</created><content type="text/html" mode="escaped">&lt;p&gt;You know how annoying the GAC shell extension makes it to access the actual assemblies:&lt;/p&gt; &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" alt="image" src="http://www.clariusconsulting.net/images/blogs/kzu/HowtogetoutoftheGACalltheregisteredassem_AA28/image.png"&gt; &lt;/p&gt; &lt;p&gt;Utterly useless. &lt;/p&gt; &lt;p&gt;Of course, you surely know that you can get to those elusive assemblies via the command-line and side-step the shell extension:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.clariusconsulting.net/images/blogs/kzu/HowtogetoutoftheGACalltheregisteredassem_AA28/image_3.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" alt="image" src="http://www.clariusconsulting.net/images/blogs/kzu/HowtogetoutoftheGACalltheregisteredassem_AA28/image_thumb.png"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;But, now you need to go to each assembly folder, then its version, and so the actual assemblies are scattered through various locations.&lt;/p&gt; &lt;p&gt;This one-liner powershell command will get them all out in a folder of your choosing for easy Reflector-ing (create the target before running it):&lt;/p&gt;&lt;pre&gt;Get-ChildItem C:\Windows\assembly\GAC_MSIL -filter *.dll -recurse | Copy-Item -destination C:\GAC&lt;/pre&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=201121" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=4OxSM7veTUY:m6-h6_38Az4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=4OxSM7veTUY:m6-h6_38Az4:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?i=4OxSM7veTUY:m6-h6_38Az4:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=4OxSM7veTUY:m6-h6_38Az4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/4OxSM7veTUY" height="1" width="1"/&gt;</content><slash:comments>3</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=201121</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2010/01/08/HowtogetoutoftheGACalltheregisteredassemblies.aspx</feedburner:origLink></entry><entry><title>Why Windows Media Center is dead</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/imsMBa7se9s/WhyWindowsMediaCenterisdead.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:199370</id><created>2010-01-03T12:55:39Z</created><content type="text/html" mode="escaped">&lt;p&gt;Windows Media Center (WMC) is based on a relatively simple (albeit awfully implemented) principle: you have ONE "server" PC holding and running your media, and then you associate any number of Media Center Extenders to it that are typically (except for the XBox 360) single-purpose devices that can only act as such and are fancy and silent enough to deserve a place in your living room.&lt;/p&gt; &lt;p&gt;I guess back in 2005, the entire model and most of Microsoft design decisions on this product may have be justifiable. 5 years later, none of them make any sense and IMO mean that WMC is currently a totally flawed, doomed and generally useless product for most common needs.&lt;/p&gt; &lt;h2&gt;Why it (kind of) made sense back then&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;Hardware: In 2005, you wouldn't dare subject your family to the noise, ugliness, quirkiness, uex, power comsumption, and cost of a full-blown "Home Theater PC" (HTPC) or an XBox power sucker. The Media Center Extender model made sense because you couldn't buy a full PC that was silent and nice-looking enough for the price of an extender. (but the extenders weren't without &lt;a href="http://linksys.custhelp.com/cgi-bin/linksys.cfg/php/enduser/std_adp.php?p_faqid=5085"&gt;limitations either&lt;/a&gt;, a good review of it at the time at the &lt;a href="http://www.winsupersite.com/reviews/mce.asp"&gt;supersite&lt;/a&gt;)&lt;/li&gt; &lt;li&gt;The user experience is quite cool (but the extenders' lower processing profile meant their UI rendering capabilities were significantly worse)&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Why it doesn't make sense anymore&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;Hardware: nowadays you can buy a full blown PC, small, silent and power-efficient for &lt;a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16883103228"&gt;$199&lt;/a&gt;-&lt;a href="http://configure.us.dell.com/dellstore/config.aspx?oc=ddcwua1&amp;amp;c=us&amp;amp;l=en&amp;amp;s=dhs&amp;amp;cs=19"&gt;$249&lt;/a&gt;. Why would you want a crippled, single-purpose device when you can have the full power of a desktop, with the capability to play back any weird format you can possibly throw at it, provided you just install the right codec. No more hardware limitations and being stuck with an &lt;a href="http://www.linksysbycisco.com/US/en/products/DMA2200"&gt;obsolete device&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;Software: back then, the Media Center team invented their own markup language to accommodate disparate rendering capabilities between a full PC, the XBox and a crippled extender. Nowadays we have WPF and Silverlight, no need to learn a new UI markup language. The extenders UI is sluggish at best, compared with what's possible in a PC with WPF/Silverlight.&lt;/li&gt; &lt;li&gt;OS: Windows 7 is a kick-ass operating system, with a ton of features. It's a snappy, sleek, touch-friendly, smart connected (i.e. "&lt;a href="http://thedigitallifestyle.com/cs/wikis/windows7/play-to-devices.aspx"&gt;Play To&lt;/a&gt;"/&lt;a href="http://dlna.org"&gt;DLNA&lt;/a&gt;, &lt;a href="http://windowsteamblog.com/blogs/windowsexperience/archive/2008/10/28/how-libraries-amp-homegroup-work-together-in-windows-7.aspx"&gt;HomeGroup&lt;/a&gt;, etc. etc.) platform. And it runs great on the smallest chips out there (it gave new life an 'old' Dell Mini 9 I had, for example). &lt;/li&gt; &lt;li&gt;Home Server: having all your media in a "plain" PC is risky. You need to take care of backups, redundancy, fault-tolerance, etc. Today, it's a &lt;a href="http://www.tomshardware.com/reviews/hp-mediasmart-server,2496-2.html"&gt;no-brainer to buy a Windows Home Server&lt;/a&gt; and let it manage all this for you, automatically, transparently, and just dead easily.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;This combination makes &lt;a href="http://xbmc.org/"&gt;desktop media management&lt;/a&gt; software a viable alternative and can certainly power your living room and projector. I believe we're at the beginning of a revolution in smart homes and connected media, just because of this new synergy and convergence.&lt;/p&gt; &lt;p&gt;If I had to start a project like that right now, I'd make it so that:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;It runs full WPF on the HTPCs connected to every TV.&lt;/li&gt; &lt;li&gt;It supports a centralized repository for the entire house (which could be a regular PC or a Windows Home Server-WHS)&lt;/li&gt; &lt;li&gt;It has a built-in extensibility model based on some dependency injection technology (i.e. MEF), and *everything* including the core functionality is a plugin&lt;/li&gt; &lt;li&gt;It leverages WHS to provide mostly the same UI over the internet by leveraging Silverlight (single programming model for both), so that I can access all the same content from everywhere, and automatically takes advantage of &lt;a href="http://www.iis.net/expand/SmoothStreaming"&gt;Smooth Streaming&lt;/a&gt; for videos.&lt;/li&gt; &lt;li&gt;It integrates with home security cameras and provides those both in the home (i.e. monitor the baby upstairs on a &lt;a href="http://en.wikipedia.org/wiki/Picture-in-picture"&gt;PiP&lt;/a&gt; window) or via the web (i.e. watch my home while on vacations) leveraging &lt;a href="http://www.iis.net/expand/LiveSmoothStreaming"&gt;Live Smooth Streaming&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;It empowers a huge plugin community that can create cool advanced features like face detection on photos and videos and security recordings, provide filtered views of those, map pictures with geocoding, provide a "home connection point" where a GPS could submit road trip info, etc. etc.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;For now, I got my &lt;a href="http://www.dell.com/us/en/corp/desktops/inspiron-zino-hd/pd.aspx?refid=inspiron-zino-hd&amp;amp;s=corp"&gt;Dell Zino HD&lt;/a&gt; (shipping soon) and I'm looking forward to selling the &lt;a href="http://www.linksysbycisco.com/US/en/products/DMA2200"&gt;assorted&lt;/a&gt; &lt;a href="http://www.amazon.com/LG-BD300-Network-Blu-ray-Player/dp/B001F5FI3S"&gt;Frankenstein&lt;/a&gt; &lt;a href="http://www.amazon.com/Hewlett-Packard-X280N-HP-MediaSmart-Connect/dp/B001AHLODY"&gt;media&lt;/a&gt; setup I have right now. &lt;/p&gt; &lt;p&gt;The future looks bright for the smart home :)&lt;/p&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=199370" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=imsMBa7se9s:gPV9RIE3siE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=imsMBa7se9s:gPV9RIE3siE:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?i=imsMBa7se9s:gPV9RIE3siE:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=imsMBa7se9s:gPV9RIE3siE:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/imsMBa7se9s" height="1" width="1"/&gt;</content><slash:comments>4</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=199370</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2010/01/03/WhyWindowsMediaCenterisdead.aspx</feedburner:origLink></entry><entry><title>How to mock extension methods</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/q_nvvtZl0lo/Howtomockextensionmethods.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:194707</id><created>2009-12-22T11:27:49Z</created><content type="text/html" mode="escaped">&lt;p&gt;. without paying for a TypeMock Isolator license to do it ;-)&lt;/p&gt; &lt;p&gt;There's going to be no magic here. You have to explicitly design for testability. That's one of the things I like about mocking: if you can mock a dependency, then it means your design is loosely coupled (e.g. not tied to a particular implementation of that dependency), and you're not "cheating or taking any shortcuts. If a test can replace a dependency at test-time, your'll surely be able to replace the real implementation with something different when/if time comes to do so.&lt;/p&gt; &lt;p&gt;Extension methods are tricky because they are static methods, really just syntactic sugar for a "good" old static class with static methods (typically a "helper" of some sort. But what is special about them, is that they show up (provided you have the right usings/imports) in the target type API as if they were its own instance methods. This is significant, because it also means that it's very easy to pollute the target type API as you (and other referenced libraries) keep piling up these methods on it.&lt;/p&gt; &lt;p&gt;I therefore prefer an approach where you group your extensions under a single API, and access that API via a single extension method on the target type that becomes the entry point to your extensions. For example, say you have an IPerson interface, and you want to add secutity-related helper methods that you can use consistently from other logic or services. One way of adding a GetPermissions security helper extension method (that will get the rights of the user over a given resource, for example), would be to plug it right into IPerson as an extension method:&lt;/p&gt;&lt;pre class="brush: csharp; smart-tabs: false;"&gt;[Flags]
public enum Permissions
{
    Read = 0, 
    Modify = 1, 
    Delete = 2, 
    FullControl = Read | Modify | Delete
}

public static class SecurityExtensions
{
    public static Permissions GetPermissions(this IPerson person, Uri resource)
    {
        // get permissions for the given resource from somewhere
    }
}

&lt;/pre&gt;
&lt;p&gt;This would get you the API right on the IPerson object:&lt;/p&gt;
&lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="plainextension" alt="plainextension" src="http://www.clariusconsulting.net/images/blogs/kzu/Howtomockextensionmethods_59FB/plainextension.png"&gt; &lt;/p&gt;
&lt;p&gt;If you go overboard with this "extension in the root" approach, you might end up with an ugly looking assorted collection of helpers attached to the main class, such as what happened to the UML APIs in Visual Studio 2010. Look at the before and after we reference and import the assembly containing the extensions to IClass (the interface that represents a class in a UML Logical Class Diagram):&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.clariusconsulting.net/images/blogs/kzu/Howtomockextensionmethods_59FB/classplain.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="classplain" alt="classplain" src="http://www.clariusconsulting.net/images/blogs/kzu/Howtomockextensionmethods_59FB/classplain_thumb.png"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;After referencing Microsoft.VisualStudio.Uml.Extensions.dll and adding the corresponding using/import:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.clariusconsulting.net/images/blogs/kzu/Howtomockextensionmethods_59FB/classextensions.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="classextensions" alt="classextensions" src="http://www.clariusconsulting.net/images/blogs/kzu/Howtomockextensionmethods_59FB/classextensions_thumb.png"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;(I pasted together four pages of intellisense for added effect, but you see the point, rigth?)&lt;/p&gt;
&lt;h2&gt;Extension Interfaces&lt;/h2&gt;
&lt;p&gt;Another alternative is to group extension methods that provide related functionality under what I'd &lt;em&gt;extension interfaces&lt;/em&gt;. In our person example, we might find out that the security-related methods start growing, and we'd like to keep the main API clean, so we introduce the ISecurity extension interface, and provide an extension method that is the entry point to it:&lt;/p&gt;&lt;pre class="brush: csharp; smart-tabs: false;"&gt;public interface ISecurity
{
    Permissions GetPermissions(Uri resource);
}

public static class SecurityExtensions
{
    public static ISecurity Security(this IPerson person)
    {
        throw new NotImplementedException();
    }
}
&lt;/pre&gt;
&lt;p&gt;Now, the consumer of the IPerson object can see that there is security-related behavior available to him, but won't see what those are unless he needs to:&lt;/p&gt;
&lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="extensioninterface" alt="extensioninterface" src="http://www.clariusconsulting.net/images/blogs/kzu/Howtomockextensionmethods_59FB/extensioninterface.png"&gt; &lt;/p&gt;
&lt;p&gt;Typically, the SecurityExtensions class will instantiate a non-public implementation of ISecurity that does the real work, passing the person to work on as a constructor argument:&lt;/p&gt;&lt;pre class="brush: csharp; smart-tabs: false;"&gt;internal class Security : ISecurity
{
    private IPerson person;

    public Security(IPerson person)
    {
        this.person = person;
    }

    public Permissions GetPermissions(Uri resource)
    {
        // get the real permissions for the person 
        // field we have received, for the given resource
        throw new NotImplementedException();
    }
}

public static class SecurityExtensions
{
    public static ISecurity Security(this IPerson person)
    {
        return new Security(person);
    }
}
&lt;/pre&gt;
&lt;p&gt;The attentive reader might have noticed that, being a regular interface, the extension interface now can expose properties where it makes sense, overcoming the lack of support for extension properties in C#. For example we could add a Roles property quite easily:&lt;/p&gt;
&lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="extensionproperty" alt="extensionproperty" src="http://www.clariusconsulting.net/images/blogs/kzu/Howtomockextensionmethods_59FB/extensionproperty.png"&gt; &lt;/p&gt;
&lt;p&gt;And because the extension interface is nothing more than a fluent interface in the end, you can use the trick I blogged about before to hide those pesky System.Object members:&lt;/p&gt;
&lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="fluentextension" alt="fluentextension" src="http://www.clariusconsulting.net/images/blogs/kzu/Howtomockextensionmethods_59FB/fluentextension.png"&gt; &lt;/p&gt;
&lt;h2&gt;How to mock extension methods, again?&lt;/h2&gt;
&lt;p&gt;Back to the testing subject, in order to test the Update method above, we'll need to replace the ISecurity implementation, right? Because we followed the extension interface design approach, we now have a single extension method to replace, the one that creates the default implementation of the ISecurity inteface. And if you look at that method, all it is being a factory for creating an implementation of ISecurity given an IPerson:&lt;/p&gt;&lt;pre class="brush: csharp; smart-tabs: false;"&gt;public static class SecurityExtensions
{
    public static ISecurity Security(this IPerson person)
    {
        return new Security(person);
    }
}
&lt;/pre&gt;
&lt;p&gt;So for testing purposes we can just add an internal factory that will isolate the extension method behavior, and that we'll replace for testing purposes:&lt;/p&gt;&lt;pre class="brush: csharp; smart-tabs: false;"&gt;public static class SecurityExtensions
{
    internal static Func&amp;lt;IPerson, ISecurity&amp;gt; SecurityFactory = person =&amp;gt; new Security(person);

    public static ISecurity Security(this IPerson person)
    {
        return SecurityFactory(person);
    }
}
&lt;/pre&gt;
&lt;p&gt;The test for the Update method above, which will have &lt;a href="http://msdn.microsoft.com/en-us/library/0tke9fxk.aspx"&gt;internals visibility&lt;/a&gt; enabled from the project under test, will simply replace the factory with one that returns a mock:&lt;/p&gt;&lt;pre class="brush: csharp; smart-tabs: false;"&gt;public void WhenPersonHasNoModifyPermission_ThenThrowsSecurityException()
{
    var security = new Mock&amp;lt;ISecurity&amp;gt;();
    security.Setup(x =&amp;gt; x.GetPermissions(It.IsAny&amp;lt;Uri&amp;gt;())).Returns(Permissions.Read);

    SecurityExtensions.SecurityFactory = person =&amp;gt; security.Object;

    var controller = new DocumentsController();

    Assert.Throws&amp;lt;SecurityException&amp;gt;(() =&amp;gt; 
        controller.Update(new Mock&amp;lt;IPerson&amp;gt;().Object, new Uri("http://foo")));
}&lt;/pre&gt;
&lt;p&gt;And voila! We have just passed a test where the class under test uses an extension method:&lt;/p&gt;&lt;pre class="brush: csharp; smart-tabs: false;"&gt;public class DocumentsController
{
    public void Update(IPerson person, Uri document)
    {
        if (!person.Security().GetPermissions(document).HasFlag(Permissions.Modify))
            throw new SecurityException();

        // ...
&lt;/pre&gt;
&lt;p&gt;Also note that the intenal Security class that implements ISecurity can also be fully tested in isolation. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Happy &lt;a href="http://moq.me"&gt;moqing&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;PS: remember the focus of this post is on mocking extension methods, not on how to design security for your domain ;-). Feel free to mentally replace ISecurity with IFoo, GetPermissions with DoSomething, etc., as needed.&lt;/p&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=194707" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=q_nvvtZl0lo:5oB6agpk_Gg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=q_nvvtZl0lo:5oB6agpk_Gg:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?i=q_nvvtZl0lo:5oB6agpk_Gg:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=q_nvvtZl0lo:5oB6agpk_Gg:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/q_nvvtZl0lo" height="1" width="1"/&gt;</content><slash:comments>5</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=194707</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2009/12/22/Howtomockextensionmethods.aspx</feedburner:origLink></entry><entry><title>Resetting Visual Studio Experimental Instance to its super-clean initial state</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/11z8bUPtaCk/194705.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:194705</id><created>2009-12-22T11:24:24Z</created><content type="text/html" mode="escaped">&lt;p&gt;If you are doing Visual Studio extensibility (VSX) work, you are probably aware of the existence of the Visual Studio "Experimental" instance. This is basically an instance of VS that has its own isolated registry, settings, extensions, etc. This allows you to test your extensions to VS without polluting your main development environment.&lt;/p&gt; &lt;p&gt;Sometimes, the environment might get corrupted for whatever reason, or it might be that you just want to test your extension with a clean environment after messing with it for a while. &lt;/p&gt; &lt;p&gt;The Visual Studio SDK does come with a tool to reset the experimental instance, available from your Start menu with the name "Reset the Microsoft Visual Studio 2010 Experimental instance". That will not, however, give you the pristine environment you got the first time you start the experimental instance to test your first extension.&lt;/p&gt; &lt;p&gt;In order to get a super-clean environment, here's what you need to do:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Close any running instance of VS Experimental.  &lt;li&gt;Delete the entire folder %LocalAppData%\Microsoft\VisualStudio\10.0Exp  &lt;li&gt;Run regedit.exe  &lt;li&gt;Delete the registry key HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0Exp  &lt;li&gt;Delete the registry key HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0Exp_Config  &lt;li&gt;Run the command "Reset the Microsoft Visual Studio 2010 Experimental instance" from your start menu.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Now you'll have a fully restored environment. Also, any existing extensions you have in your main environment will be copied over to the experimental instance, with one caveat: you'll have to manually enable them from the Extension Manager UI from a running experimental instance to get them running.&lt;/p&gt; &lt;p&gt;If you've been doing VSX work in previous versions of VS, you'll sure appreciate the drastically simplified install/reset experience enabled by the new deployment mechanism in VS2010 via Extension Manager and VSIX files. If you have not, then this doesn't sound so scary anymore, does it? ;-)&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Happy extending!&lt;/p&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=194705" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=11z8bUPtaCk:DPuDSO2K6h4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=11z8bUPtaCk:DPuDSO2K6h4:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?i=11z8bUPtaCk:DPuDSO2K6h4:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=11z8bUPtaCk:DPuDSO2K6h4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/11z8bUPtaCk" height="1" width="1"/&gt;</content><slash:comments>1</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=194705</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2009/12/22/194705.aspx</feedburner:origLink></entry><entry><title>Clarius Visual T4 70% off!</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/ZPmWgvJgyOI/186823.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:186823</id><created>2009-11-30T09:19:39Z</created><content type="text/html" mode="escaped">&lt;p&gt;&lt;a href="http://twitter.com/vga/status/6204238634"&gt;http://twitter.com/vga/status/6204238634&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Go get it :)&lt;/p&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=186823" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=ZPmWgvJgyOI:jdFkb4Go3dY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=ZPmWgvJgyOI:jdFkb4Go3dY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?i=ZPmWgvJgyOI:jdFkb4Go3dY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=ZPmWgvJgyOI:jdFkb4Go3dY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/ZPmWgvJgyOI" height="1" width="1"/&gt;</content><slash:comments>2</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=186823</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2009/11/30/186823.aspx</feedburner:origLink></entry><entry><title>Reactive Framework Extensions Generator</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/0JWO2sPVYFU/ReactiveFrameworkExtensionsGenerator.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:185514</id><created>2009-11-26T08:56:36Z</created><content type="text/html" mode="escaped">&lt;p&gt;You probably know already that the Reactive Framework Extensions (Rx) is a new library on top of .NET 4.0 and Silverlight that allows developers to leverage the expressiveness and power of LINQ for .NET events. It brings an entirely new paradigm for doing event-driven apps, and therefore shines in WPF/Silverlight scenarios.&amp;nbsp; &lt;p&gt;Read more about Rx at the &lt;a href="http://blogs.msdn.com/RxTeam/"&gt;team blog&lt;/a&gt;, the &lt;a href="http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx"&gt;project home page&lt;/a&gt; and &lt;a href="http://codebetter.com/blogs/matthew.podwysocki/archive/2009/11/18/introduction-to-the-reactive-framework-part-v.aspx"&gt;Matthew excelent blog series&lt;/a&gt;.  &lt;p&gt;&amp;nbsp; &lt;p&gt;Even with the general availability of the &lt;a href="http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx"&gt;bits for VS2010 beta2 at DevLabs&lt;/a&gt;, there's still quite a bit of work you need to do in order to leverage the extensions. Specifically, you need to turn your events into &lt;a href="http://msdn.microsoft.com/en-us/library/dd990377(VS.100).aspx"&gt;IObservables&lt;/a&gt; that can then use the Rx extensions for querying and subscribing. This is a lot of repetitive and boring code that can be easily automated.  &lt;p&gt;That's precisely what this &lt;a href="http://clarius.codeplex.com"&gt;Clarius Labs&lt;/a&gt; provided extension does, enabling Reactive Framework Extensions for arbitrary assemblies, without writing any code. It basically traverses all public types in a given assembly (i.e. PresentationFramework.dll, for WPF) and generates a "Reactive" assembly for it (i.e. PresentationFramework.Reactive.dll) which contains the necessary extension methods for all public types that expose generic or custom delegate events that can be automatically converted to &lt;a href="http://msdn.microsoft.com/en-us/library/dd990377(VS.100).aspx"&gt;IObservables&lt;/a&gt;. With that in place, you can simply use the Reactive() extension method on your classes and access in a strong-typed fashion all events of that type as &lt;a href="http://msdn.microsoft.com/en-us/library/dd990377(VS.100).aspx"&gt;IObservables&lt;/a&gt;:  &lt;p&gt;&lt;img title="Typed events as IObservables" alt="Typed events as IObservables" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=clarius&amp;amp;DownloadId=94584"&gt;&lt;/p&gt; &lt;p&gt;In order to get the extensions assembly generated, you simply right-click on a project or assembly reference, and select "Create Reactive Extensions":&lt;/p&gt; &lt;p&gt;&lt;img title="Executing the command" alt="Executing the command" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=clarius&amp;amp;DownloadId=94586"&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;and a new assembly will be generated and referenced automatically:&lt;/p&gt; &lt;p&gt;&lt;img title="Reference added" alt="Reference added" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=clarius&amp;amp;DownloadId=94587"&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;which will enable you to use LINQ operators and the new Observable APIs for all events exposed on all public types for the given assembly.&lt;/p&gt; &lt;p&gt;&lt;a href="http://codebetter.com/blogs/matthew.podwysocki/archive/2009/11/12/introduction-to-the-reactive-framework-part-iii.aspx"&gt;Matthew sample&lt;/a&gt; using our generator looks like:&lt;/p&gt;&lt;pre class="brush: csharp; smart-tabs: false;"&gt;var mouseMoves = from mm in mainCanvas.Reactive().MouseMove
                 let location = mm.EventArgs.GetPosition(mainCanvas)
                 select new { location.X, location.Y };

var mouseDiffs = mouseMoves
    .Skip(1)
    .Zip(mouseMoves, (l, r) =&amp;gt; new { X1 = l.X, Y1 = l.Y, X2 = r.X, Y2 = r.Y });

var mouseDrag = from _ in mainCanvas.Reactive().MouseLeftButtonDown
                from md in mouseDiffs.Until(
                    mainCanvas.Reactive().MouseLeftButtonUp)
                select md;
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Go to the &lt;a href="http://visualstudiogallery.msdn.microsoft.com/en-us/0791089a-4570-4f21-b5ee-78aba7e80651"&gt;Visual Studio Gallery&lt;/a&gt; and give it a try!&lt;/p&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=185514" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=0JWO2sPVYFU:NkiRgu2DgZo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=0JWO2sPVYFU:NkiRgu2DgZo:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?i=0JWO2sPVYFU:NkiRgu2DgZo:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=0JWO2sPVYFU:NkiRgu2DgZo:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/0JWO2sPVYFU" height="1" width="1"/&gt;</content><slash:comments>6</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=185514</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2009/11/26/ReactiveFrameworkExtensionsGenerator.aspx</feedburner:origLink></entry><entry><title>The myth that TDD or test-first slows you down is true</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/uF-a2ACHCxQ/172741.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:172741</id><created>2009-10-04T12:16:53Z</created><content type="text/html" mode="escaped">&lt;p&gt;I'm sad to say it, but it is true. It slows you down. But not everytime, and not for everything. So let's be more specific on the cases where it DOES slow you down noticeably:&lt;/p&gt; &lt;h3&gt;&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Cowboy or Duct Tape Programming Mode&lt;/strong&gt;: If you code all day like crazy in a "&lt;a href="http://tddtrainingcourse.blogspot.com/2009/09/tdd-shoots-cowboy-off-his-speedy-horse.html"&gt;cowboy&lt;/a&gt;" or "&lt;a href="http://www.joelonsoftware.com/items/2009/09/23.html"&gt;duct tape&lt;/a&gt;" programming mode, then it WILL slow you down, significantly. In this mode, you're hacking together stuff that works by pure luck, you're only superficially and typically manually "testing" the thing, before calling it "done" and move on. Someone will come after some day when the customer complains about a bug, and figure out what to do. Not your problem though, for sure. For all you care about, you might even have another job by then. Your productivity kicks ass, you're the fastest guy in the team, and can get "complete" features to your boss in record time. Everyone (who hasn't worked with you long enough) thinks you're a genious, 'cause you can get something that works on the first shot. Brilliant!&lt;br&gt;&lt;br&gt;It may also be just the way you are, and it's not that you don't care. It's just that your fingers fly and the itch to get the code done is SO strong that you just can't help it. Once I overheard an architect saying "I'm gonna tie your fingers with rubber bands!", hehe.&lt;br&gt;&lt;br&gt;TDD WILL SLOW YOU DOWN, A **LOT**.&lt;br&gt; &lt;li&gt;&lt;strong&gt;Visual Studio Extensibility or Mobile Development&lt;/strong&gt;: the red/green/refactor cycle is just so brutally slow that it's a real endurance test to try to keep doing TDD in many cases. Yes, you can isolate the IDE/Mobile environment, mock stuff here and there, but at the end of the day, the mock does not guarantee that things will actually work on the real thing. So you need to run tests on the actual environment more often than not. You'll spend a great deal of time trying to isolate slow areas, trying to write more code before you run just to avoid the slow turnaround (and then fixing multiple things in a single pass when multiple fail), etc. A total TDD-anti-climax for sure :(&lt;br&gt;&lt;/li&gt;TDD WILL SLOW YOU DOWN, **SIGNIFICANTLY**. &lt;br&gt;&lt;br&gt; &lt;li&gt;&lt;strong&gt;Show Customer Value, Quickly&lt;/strong&gt;: there are some cases where the domain you're tackling is not very well explored, or the customer doesn't have a very clear idea of what to expect, or doesn't even believe you can deliver something valuable or innovative at all. In these cases, it's much more important to have a lot of tangible value/features soon, than to have little but very robust and well designed via TDD. &lt;br&gt;&lt;/li&gt;TDD WILL SLOW YOU DOWN, AND YOU MAY NOT HAVE A PROJECT AT ALL SOONER THAN LATER&lt;br&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Of these, the first one is one that requires careful attention and mentoring. Being a speedy programmer certainly is a good quality and an important one to being great, I think. There are times when you just need to be bloody fast and get the job done quickly (third case). Such a developer is invaluable in an organization. But he must understand the constraints of the current project. Getting rock-solid, maintainable and well-designed code might be much more important than raw amount of features/code. &lt;/p&gt; &lt;p&gt;The second and third cases are just a matter of setting the right expectations, and understand how you're going to approach development. In either, you might skip TDD altogether, or do it only in more complicated areas only. Or you might just have what you can as integration tests only.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;And yes, being pragmatic is also a very good quality to have. Shipping is indeed a feature.&lt;/p&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=172741" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=uF-a2ACHCxQ:JAC-l-zsFKM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=uF-a2ACHCxQ:JAC-l-zsFKM:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?i=uF-a2ACHCxQ:JAC-l-zsFKM:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=uF-a2ACHCxQ:JAC-l-zsFKM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/uF-a2ACHCxQ" height="1" width="1"/&gt;</content><slash:comments>16</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=172741</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2009/10/04/172741.aspx</feedburner:origLink></entry><entry><title>Writing meaningful, self-documenting, behavior-oriented tests</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/cLyGf8OhFro/171565.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:171565</id><created>2009-10-01T06:11:43Z</created><content type="text/html" mode="escaped">&lt;p&gt;Over the years I've come to realize that the one-fixture-per-class approach to unit testing just doesn't scale. As the amount of variations in state and interactions increases, that file starts becoming a big soup of "Should" methods that are increasingly difficult to traverse and find later on. Essentially, since every test is doing the first "A" in AAA (Arrange-Act-Assert) too, that means the context is also part of the test method.&lt;/p&gt; &lt;p&gt;You can only make a method so long and remain understandable at a glance: IfRepositoryContainsACustomerAndAddingANewOneWithSameIdButDifferentAliasThenThrowsInvalidArgumentException. So, a while ago at Clarius &lt;a href="http://www.clariusconsulting.net/blogs/kzu/archive/2009/03/13/120996.aspx"&gt;we started exploring&lt;/a&gt; some of the concepts behind BDD (Behavior Driven Development), Context/Specification, etc., while working on an internal project. &lt;/p&gt; &lt;p&gt;I was more than pleased with the compromise we made to accommodate our current tools, and to land in a place that is not totally alien for the regular "barebones"TDD guy. I'm convinced that changing paradigms just for this isn't probably worth it.&lt;/p&gt; &lt;p&gt;In my last post I hinted at one of the core values I see with TDD/unit testing: self-documenting code. Any kind of non-trivial code will involve a series of back and forth with the customer, numerous changes to a written spec (if you're lucky to have one) and its increasing and inevitable obsolescence. In most cases where I'm given enough freedom (i.e. the customer knows us well and trusts our development process and guaranteed quality), I usually get very few written specs, if any. A lot of details are just talked over standup (or IP), and many details are left for us to figure out. And that's fine: that's the reason you're the one with the keyboard writing code, and with the brains to make reasonable design choices if you understand the problem space well enough.&lt;/p&gt; &lt;p&gt;You could get picky with the customer and start asking for explicit definitions for everything. Tried that too, doesn't get you too far. In a short term, you're either out of the project 'cause you're too much of an overhead to an already busy person, or the customer gets even more exasperatingly vague and confusing as he tries hard to explain in detail something that doesn't even know yet for sure, while leaving crucial execution paths out, at which point you either quit politely, or go "don't worry, let me figure that out for you". Back to square zero.&lt;/p&gt; &lt;p&gt;The fact that the customer didn't know quite yet what he wanted, does certainly mean he doesn't want to know what he's getting. What you thought it was that he needed. So, you need to write whatever you write in such a way that it's easy to transform into a human-readable form that you can hand out to your customer. &lt;/p&gt; &lt;p&gt;So, without further ado, here's the way we write tests:&lt;/p&gt;&lt;pre class="brush: csharp; gutter: false; toolbar: false; smart-tabs: false;"&gt;namespace Runtime.Workflow.JoinSpec
{
   [TestClass]
   public class GivenAJoinWithTwoPredecessorsAndOneSuccessor
   {
     // ctor builds up the context

     [TestMethod]
     public void WhenAPredecessorIsAvailable_ThenJoinIsBlocked()
     {
       // set predecesor state,&lt;br&gt;       // verify the join has the given state
     }

     [TestMethod]
     public void WhenBothPredecessorsAreFinished_ThenJoinIsFinished()
     {
       // set predecesor state&lt;br&gt;       // verify the join changed state to Finished
     }
   }
}&lt;/pre&gt;
&lt;p&gt;How it works:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The last part of the namespace becomes the logical grouping of the tests. This typically is the name of the class under test plus the "Spec" suffix. 
&lt;li&gt;The test class starts with "Given" and the phrase that follows describes what's instantiated in the constructor and typically stored in fields for use by tests. The Given is the Arrange in AAA. 
&lt;li&gt;Test methods have two parts: "When" and "Then", separated by an underscore. 
&lt;ul&gt;
&lt;li&gt;When: describes the action or state change that is caused in the context to perform the test. This is the Act in AAA. This is typically just one operation, but it could be more if changing the state/acting requires so. 
&lt;li&gt;Then: the Assert in AAA. Typically just one Assert or mock Verify, but there could be more than one if verifying the state/interactions require so. But in either case, the Then should describe what you're asserting.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Key benefits of this approach:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This is plain MSTest code. You could as well use xUnit, NUnit, etc. No new paradigms to learn, just some naming conventions. 
&lt;li&gt;The only additional "overhead" is having a separate context (Given) class to group related tests (those tests that use the same setup). 
&lt;li&gt;Having a convention in place for how to write tests has proven immensely valuable on its own. I can navigate our tests and not tell the difference on who wrote which tests. 
&lt;li&gt;It triggers good practices about test complexity almost automatically: because context + tests have to make sense as an english phrase, sometimes you realize that a given test is testing too much (the test method becomes TOOOO long to write). 
&lt;li&gt;It's trivial to write code that uses reflection to render this as a document&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We use this as a guideline. There's no requirement that we have a context class. Sometimes, it's just not worth it because you're testing a very small unit. In this case, the *Spec becomes the class, such as:&lt;/p&gt;&lt;pre class="brush: csharp; gutter: false; toolbar: false; smart-tabs: false;"&gt;namespace Runtime.Workflow
{
   [TestClass]
   public class FinalSpec&lt;br&gt;   {&lt;br&gt;   }&lt;br&gt;}&lt;/pre&gt;
&lt;p&gt;This is typically more the exception than the rule, though. &lt;/p&gt;
&lt;p&gt;To render specs I quickly put together a query that uses reflection:&lt;/p&gt;&lt;pre class="brush: csharp; collapse: true; smart-tabs: false;"&gt;public class RenderSpecs
{
    public void Render()
    {
        // Change and run with TestDriven.NET to get the specs for a given 
        // namespace:
        Render("Runtime.Workflow", Console.Out);
    }

    public void RenderAllSpecs()
    {
        using (var stream = File.Open(@"..\..\Specs.txt", FileMode.Create))
        using (var writer = new StreamWriter(stream))
        {
            Render("", writer);
        }
    }

    private void Render(string withinNamespace, TextWriter output)
    {
        var specs = (from type in this.GetType().Assembly.GetTypes()
                     where type.Namespace != null &amp;amp;&amp;amp; type.Namespace.StartsWith(withinNamespace) &amp;amp;&amp;amp;
                         type.GetCustomAttributes(true).OfType&amp;lt;TestClassAttribute&amp;gt;().Any()
                     from method in type.GetMethods()
                     where method.GetCustomAttributes(true).OfType&amp;lt;TestMethodAttribute&amp;gt;().Any() &amp;amp;&amp;amp;
                        method.Name.StartsWith("When")
                     orderby type.Namespace, type.Name
                     select new
                     {
                         Type = type, 
                         Method = method,
                         //Phrase = method.Name,
                         When = ToPhrase(method.Name.Substring(0, method.Name.IndexOf('_'))),
                         Then = ToPhrase(method.Name.Substring(method.Name.IndexOf('_') + 1)),
                     })
                    .GroupBy(x =&amp;gt; x.Type)
                    .OrderBy(x =&amp;gt; x.Key.FullName)
                    .GroupBy(x =&amp;gt; x.Key.Namespace);

        foreach (var ns in specs)
        {
            output.WriteLine(new string('-', 50));
            output.WriteLine(ToPhrase(ns.Key.Split('.').Last(), false));

            foreach (var context in ns)
            {
                output.WriteLine("    " + ToPhrase(context.Key.Name));
                foreach (var spec in context.OrderBy(spec =&amp;gt; spec.When).ThenBy(spec =&amp;gt; spec.Then))
                {
                    output.WriteLine( "        " + spec.When + ", " + spec.Then);
                    //Console.WriteLine("\t" + spec.Phrase);
                }
            }
        }
    }

    private static string ToPhrase(string pascalCasedPhrase)
    {
        return ToPhrase(pascalCasedPhrase, true);
    }


    private static string ToPhrase(string pascalCasedPhrase, bool toLower)
    {
        var builder = new StringBuilder();
        builder.Append(pascalCasedPhrase.First());

        for (int i = 1; i &amp;lt; pascalCasedPhrase.Length; i++)
        {
            if (Char.IsUpper(pascalCasedPhrase[i]))
                builder.Append(" ");

            builder.Append(pascalCasedPhrase[i]);
        }

        var phrase = builder.ToString();

        if (toLower)
        {
            phrase = phrase.ToLower(CultureInfo.CurrentCulture);
            // Make only When and Then upper case
            phrase = phrase.Replace("given", "Given").Replace("when", "When").Replace("then", "Then");
        }

        return phrase;
    }
}
&lt;/pre&gt;
&lt;p&gt;Note that this class is not a test class or test method. That's because we render on-demand. When I need to discuss or explain how a given area works, I'll go and render the specs first, email it and then meet. To run the Render method, I use &lt;a href="http://testdriven.net"&gt;TestDriven.NET&lt;/a&gt; which can run any method on any class (with a default constructor). I use it to run all tests too :), it's SOOOO much speedier than the VS runner...&lt;/p&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=171565" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=cLyGf8OhFro:HpXVEjqUumo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=cLyGf8OhFro:HpXVEjqUumo:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?i=cLyGf8OhFro:HpXVEjqUumo:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=cLyGf8OhFro:HpXVEjqUumo:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/cLyGf8OhFro" height="1" width="1"/&gt;</content><slash:comments>6</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=171565</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2009/10/01/171565.aspx</feedburner:origLink></entry><entry><title>Are you smart enough to do without TDD</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/49lacRvwPQQ/AreyousmartenoughtodowithoutTDD.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:171102</id><created>2009-09-29T21:18:40Z</created><content type="text/html" mode="escaped">&lt;p&gt;Ayende wrote a controversial post titled &lt;strike&gt;I'm so smart I don't need TDD&lt;/strike&gt; &lt;a href="http://ayende.com/Blog/archive/2009/09/28/even-tests-has-got-to-justify-themselves.aspx"&gt;Even tests has got to justify themselves&lt;/a&gt; ;-). It's important to read it, because it reinforces many of the reasons why "regular developers" (i.e. NOT *you* if you're even reading blogs as you are) continue to see "us" as some kind of unreachable and infallible elite of "hero programmers" who will eventually show up (i.e. be hired for big bucks, which we surely do want :)) and save the day.&lt;/p&gt; &lt;p&gt;You see, Ayende appears to say that if you're smart enough, you'll just know what code to write, just like that. Ergo, if you don't know, maybe you're not that smart and hence you would need this technique for losers called Test Driven Design/Development.&lt;/p&gt; &lt;p&gt;That's not how it works, at least for me. Far from it. I've been doing TDD for years on several projects and with varying degrees of similarity. And I can tell you that even for those where I already had a very clear idea of an initial design, I always ended up with something (however slightly) different after doing it TDD-style. It consistently enriches my APIs by providing me a users point of view that an integration/scenario test would never give me. &lt;/p&gt; &lt;h3&gt;Spikes&lt;/h3&gt; &lt;p&gt;With regards to design uncertainty (which is what Ayende mentions as his only motivator for doing TDD), I usually take a different approach altogether: run a quick time-boxed spike (or several), to test a couple design choices quickly, without the "overhead" of doing it "right". These are throw-away spikes that you learn from. When I'm done with the learning, I go back to doing it with TDD, and it's almost guaranteed it will not look 100% like the spikes, and that it will be much more robust and user-friendly.&lt;/p&gt; &lt;h3&gt;Documentation &lt;/h3&gt; &lt;p&gt;A new appreciation I'm developing for TDD when done with certain consistent naming conventions (i.e. Given, When, Then style), is the ability to have a human readable and always up to date specification of what the various components do. Yes, this is not something you'll show your end users, but it IS something the developer or project lead coming after you can certainly learn from. Ayende assumes everyone will be equally smart as he is and immediately grasp his software designs, 'cause you know, there's only one way it could have been done right :P. In order to fix bugs and maintain non-trivial software, you need to know what individual components are doing.&lt;/p&gt; &lt;h3&gt;Proof&lt;/h3&gt; &lt;p&gt;I'll refer to one case of each situation where TDD provided value.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://moq.me"&gt;Moq&lt;/a&gt; vs &lt;a href="http://www.mockframeworks.com/rhino"&gt;Rhino Mocks&lt;/a&gt;: he read the (&lt;a href="http://www.clariusconsulting.net/blogs/kzu/archive/2007/12/27/48594.aspx"&gt;useless IMO&lt;/a&gt;) literature on mocks vs stubs vs fakes, had apparently a clear idea of what to do, and came up with Rhino's awkward, user unfriendly and hard to learn API with a myriad of concepts and options, and a record-replay-driven API (ok, I'm sure it was not his original idea, but certainly it's his impl.) which two years ago seemed to him to &lt;a href="http://ayende.com/Blog/archive/2007/12/26/The-RecordReplayVerify-model.aspx"&gt;stand at the core of mocking&lt;/a&gt;. Nowadays not only he learned what I've been saying all along, that "&lt;a href="http://ayende.com/Blog/archive/2009/09/03/planning-for-rhino-mocks-4.0.aspx"&gt;dynamic, strict, partial and stub... No one cares&lt;/a&gt;", but also is planning to remove the &lt;a href="http://ayende.com/Blog/archive/2009/09/03/planning-for-rhino-mocks-4.0.aspx"&gt;record / playback API&lt;/a&gt; too. &lt;br&gt;&lt;br&gt;I'm pretty sure that if he had sat down with a blank project, two years ago, and rebuilt Rhino Mocks using TDD and a fresh mind, he would have ended with something very similar to &lt;a href="http://moq.me"&gt;Moq&lt;/a&gt;, way earlier, rather than seeming to be playing catch-up. &lt;br&gt;&lt;br&gt;&lt;a href="http://moq.me"&gt;Moq&lt;/a&gt; on the other hand started from a blank slate, purely TDD-driven, with no preconceptions whatsoever on its API (other than the conviction that we just need one word, "mock"). I'm obviously biased, but &lt;a href="http://moq.me/wiki/ILoveMoq"&gt;users seem to love&lt;/a&gt; its &lt;a href="http://search.twitter.com/search?q=moq"&gt;simplicity too&lt;/a&gt;. &lt;br&gt; &lt;li&gt;Complex behavior: on a farily complex workflow-related implementation, I recently got asked what the behavior of a Join node was in our project. I could just run a test that does a very simple reflection-driven query and get the following answer to the project lead: &lt;pre&gt;Join Spec
  Given a join with two predecessors and one successor
     When a predecessor is available, Then join is blocked
     When a predecessor is blocked, Then join is blocked
     When a predecessor is in progress, Then join is blocked
     When a predecessor is unknown, Then join is blocked
     When a successor state changes, Then join state does not change
     When both predecessors are finished, Then join is finished&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;That is simply invaluable. Anyone coming later to the project only needs to read that to grasp an immediate understanding of the intended behavior. And it's isolated and unit-tested. How does the test code look like? Well, pretty much like your regular TDD-style, but with some naming conventions: &lt;/p&gt;&lt;pre class="brush: csharp; gutter: false; toolbar: false; smart-tabs: false;"&gt;namespace JoinSpec
{
   [TestClass]
   public class GivenAJoinWithTwoPredecessorsAndOneSuccessor
   {
     // ctor builds up the context
     [TestMethod]
     public void WhenAPredecessorIsAvailable_ThenJoinIsBlocked()
     {
       // set predecesor state, and verify the join is with the given state
     }
   }
}&lt;/pre&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=171102" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=49lacRvwPQQ:tjyjHS5q9D0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=49lacRvwPQQ:tjyjHS5q9D0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/49lacRvwPQQ" height="1" width="1"/&gt;</content><slash:comments>287</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=171102</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2009/09/29/AreyousmartenoughtodowithoutTDD.aspx</feedburner:origLink></entry><entry><title>How to always open the vsixmanifest in XML view</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/qxREcbGcjYI/165066.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:165066</id><created>2009-08-17T19:53:19Z</created><content type="text/html" mode="escaped">&lt;p&gt;The new &lt;a title="tons of VSIX information from Pablo Galiano" href="http://www.clariusconsulting.net/blogs/pga/archive/category/1058.aspx"&gt;VSIX projects&lt;/a&gt; contain a manifest that is by default opened with a designer. No matter how many times you specify that you want to open it with the XML editor by default, VS will continue to open it with the designer.&lt;/p&gt; &lt;p&gt;The only way to force the change is to manually modify the .csproj as follows:&lt;/p&gt;&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;&amp;lt;ItemGroup&amp;gt;
  &amp;lt;None Include="source.extension.vsixmanifest"&amp;gt;
    &amp;lt;SubType&amp;gt;&lt;strike&gt;Designer&lt;/strike&gt;Code&amp;lt;/SubType&amp;gt;
  &amp;lt;/None&amp;gt;
&amp;lt;/ItemGroup&amp;gt;
&lt;/pre&gt;
&lt;p&gt;(on Beta1, the manifest file name would be just extension.vsixmanifest)&lt;/p&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=165066" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=qxREcbGcjYI:aqWlqQGj2sw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=qxREcbGcjYI:aqWlqQGj2sw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/qxREcbGcjYI" height="1" width="1"/&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=165066</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2009/08/16/165066.aspx</feedburner:origLink></entry><entry><title>Linq to Mocks is finally born</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/-PrLuu1VU2w/164978.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:164978</id><created>2009-08-13T06:55:38Z</created><content type="text/html" mode="escaped">
		&lt;p&gt;Last time I announced Linq to Mocks, some said &lt;a href="http://moq.me"&gt;Moq&lt;/a&gt; didn't actually have anything to do with Linq. Despite the heavy usage of lambda expressions and expression trees, the "q" in Linq is for "query" after all. And they were right, of course, but it was fun anyway, and the name is definitely cool IMO :).&lt;/p&gt;
		&lt;p&gt;But this time around, I'm happy to say that it's finally true. What the next version of Moq (early &lt;a title="Moq Downloads" href="http://moq.me/get"&gt;beta readily available now&lt;/a&gt;) allows you to express in a very declarative way essentially is: &lt;/p&gt;
		&lt;blockquote&gt;
				&lt;p&gt;
						&lt;em&gt;from the universe of mocks, get me those that behave like this&lt;/em&gt;
						&lt;br /&gt;(thanks &lt;a href="http://www.clariusconsulting.net/blogs/fds"&gt;Fernando Simonazzi&lt;/a&gt; for coming up with this phrase :))
				&lt;/p&gt;
		&lt;/blockquote&gt;
		&lt;p&gt;Rather than procedurally defining how the mock will behave, its specification is part of the query:&lt;/p&gt;
		&lt;pre class="brush: csharp; gutter: false; toolbar: false; smart-tabs: false;"&gt;ControllerContext controllerContext =
    (from context in Mocks.Query&amp;lt;ControllerContext&amp;gt;()
     where context.HttpContext.User.Identity.Name == "kzu" &amp;amp;&amp;amp;
           context.HttpContext.Request.IsAuthenticated == true &amp;amp;&amp;amp; 
           context.HttpContext.Request.Url == new Uri("http://moq.me") &amp;amp;&amp;amp;
           context.HttpContext.Response.ContentType == "application/xml"
     select context)
    .First();
&lt;/pre&gt;
		&lt;p&gt;A few things to notice:&lt;/p&gt;
		&lt;ol&gt;
				&lt;li&gt;The query returns an infinite list of mocks that behave according to the specification/query. You typically get the first of such list. 
&lt;/li&gt;
				&lt;li&gt;The resulting objects are of the actual mocked type, not Mock&amp;lt;T&amp;gt;, so there's no need to do controllerContext.Object anymore. The reasoning for that is that typically you would be able to fully setup the mock in the query, hence there'd be no need to get the Mock&amp;lt;T&amp;gt; back, unlike new Mock&amp;lt;T&amp;gt; where you do need to set it up. 
&lt;/li&gt;
				&lt;li&gt;Fluent mocking happens automatically within the query. And even better, you're NOT limited to just property accesses. *Anything* that is a valid Setup on a mock can appear anywhere in the fluent mock traversal (i.e. context.HttpContext.GetSection("server") == configuration) 
&lt;/li&gt;
				&lt;li&gt;You can have multiple mocks within the query and set them all up together. 
&lt;/li&gt;
				&lt;li&gt;If you want to access these multiple mocks afterwards, you can just return all of them using an anonymous type projection (select new { Context = context, Configuration = configuration } ).&lt;/li&gt;
		&lt;/ol&gt;
		&lt;p&gt;Here's a more comprehensive example of setting up two mocks at the same time:&lt;/p&gt;
		&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;ControllerContext controllerContext =
    (from context in Mocks.Query&amp;lt;ControllerContext&amp;gt;()
     from configuration in Mocks.Query&amp;lt;ServerSection&amp;gt;()
     where context.HttpContext.User.Identity.Name == userName &amp;amp;&amp;amp;
           context.HttpContext.Request.IsAuthenticated == true &amp;amp;&amp;amp; 
           context.HttpContext.Request.Url == new Uri("http://moq.me") &amp;amp;&amp;amp;
           context.HttpContext.Response.ContentType == "application/xml" &amp;amp;&amp;amp;
           context.HttpContext.GetSection("server") == configuration &amp;amp;&amp;amp; 
           configuration.Server.ServerUrl == new Uri("http://moq.me/api")
     select context)
    .First();
&lt;/pre&gt;
		&lt;p&gt;Finally, if you needed to access both the context as well as the configuration from the results of this query, you could do:&lt;/p&gt;
		&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;var mocks =
    (from context in Mocks.Query&amp;lt;ControllerContext&amp;gt;()
     from configuration in Mocks.Query&amp;lt;ServerSection&amp;gt;()
     where context.HttpContext.User.Identity.Name == userName &amp;amp;&amp;amp;
           context.HttpContext.Request.IsAuthenticated == true &amp;amp;&amp;amp; 
           context.HttpContext.Request.Url == new Uri("http://moq.me") &amp;amp;&amp;amp;
           context.HttpContext.Response.ContentType == "application/xml" &amp;amp;&amp;amp;
           context.HttpContext.GetSection("server") == configuration &amp;amp;&amp;amp; 
           configuration.Server.ServerUrl == new Uri("http://moq.me/api")
     select new { Context = context, Configuration = configuration }))
    .First();

MyController controller = new MyController { ControllerContext = mocks.Context };
// Do something with the configuration object...
ServerSection config = mocks.Configuration;
&lt;/pre&gt;
		&lt;p&gt;Next question would be how to setup exceptions to be thrown, and how to verify? You just use the existing &lt;a href="http://api.moq.me/html/C6B12927.htm"&gt;Mock.Get&lt;/a&gt; functionality:&lt;/p&gt;
		&lt;pre class="brush: csharp; gutter: false; toolbar: false; smart-tabs: false;"&gt;Mock.Get(controllerContext).Setup(...)&lt;br /&gt;// or verify&lt;br /&gt;Mock.Get(controllerContext).Verify(...);&lt;/pre&gt;
		&lt;p&gt;Just for the sake of comparison, the equivalent "procedural" code to setup the same mock shown in the complete example above, you'd currently do:&lt;/p&gt;
		&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;var context = new Mock&amp;lt;ControllerContext&amp;gt;();
var configuration = new Mock&amp;lt;ServerSection&amp;gt;();

context.SetupGet(c =&amp;gt; c.HttpContext.User.Identity.Name).Returns(userName);
context.SetupGet(c =&amp;gt; c.HttpContext.Request.IsAuthenticated).Returns(true);
context.SetupGet(c =&amp;gt; c.HttpContext.Request.Url).Returns(new Uri("http://moq/me"));
context.SetupGet(c =&amp;gt; c.HttpContext.Response.ContentType).Returns("application/xml");
context.SetupGet(c =&amp;gt; c.HttpContext.User.Identity.Name).Returns(userName);
context.Setup(c =&amp;gt; c.HttpContext.GetSection("server")).Returns(configuration);
configuration.Setup(c =&amp;gt; c.Server.ServerUrl).Returns(new Uri("http://moq.me/api"));
&lt;/pre&gt;
		&lt;p&gt;Yes, the query version has one more line of code, the &lt;code&gt;.First()&lt;/code&gt; call. Yes, it's gonna be largely a matter of personal style and preference, just like many prefer invoking &lt;code&gt;.Where(…)&lt;/code&gt; and &lt;code&gt;.Select(…)&lt;/code&gt; instead of &lt;code&gt;from…where…select&lt;/code&gt;.&lt;/p&gt;
		&lt;p&gt;Choice is good in this case, IMO.&lt;/p&gt;
		&lt;p&gt;There are many more features in this upcoming version of Moq. I'll try to blog about those too before/after we ship :). But this is my favorite!&lt;/p&gt;
		&lt;p&gt;
				&lt;a href="http://moq.me/get"&gt;Go get it&lt;/a&gt;!&lt;/p&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=164978" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=-PrLuu1VU2w:KUB4SAzRRsI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=-PrLuu1VU2w:KUB4SAzRRsI:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/-PrLuu1VU2w" height="1" width="1"/&gt;</content><slash:comments>6</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=164978</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2009/08/13/164978.aspx</feedburner:origLink></entry><entry><title>Improved type safety when dealing with generic types, generic methods and reflection</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/sAzHyIL1EVQ/164828.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:164828</id><created>2009-08-10T07:49:30Z</created><content type="text/html" mode="escaped">
		&lt;p&gt;Compile-time safety is always important, as it reduces the chances that a refactoring can break existing code that compiles successfully. This benefit took me previously to the path of using expression trees to achieve strong-typed reflection. &lt;/p&gt;
		&lt;p&gt;There is, however, an alternative that works on previous versions of .NET and doesn’t involve expression trees. It essentially involves creating a delegate of the target method, and using the delegate properties to get to the corresponding MethodInfo:&lt;/p&gt;
		&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;Action&amp;lt;string&amp;gt; writeLine = Console.WriteLine;
MethodInfo writeLineMethod = writeLine.Method;&lt;/pre&gt;
		&lt;p&gt;Note that the code above is very explicit about which overload of the WriteLine method to pick: the one with a single string argument and a void return value. You can leverage Action and Func various overloads to represent pretty much any method invocation. Also, if those do not fit, you can still create your own delegate type. The benefit, clearly, is that you now can refactor the defining class or method and the change will be picked automatically.&lt;/p&gt;
		&lt;p&gt;The above example dealt with a static method call. Instance methods require an actual instance, but you can still use the technique to reflect over the method metadata &lt;strike&gt;What about instance methods? You certainly don't want to instantiate the target type just to do a more safe reflection over it, right? Well, because we're only retrieving a delegate to a method, but not actually executing it, passing a null is perfectly fine&lt;/strike&gt;:&lt;/p&gt;
		&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;Func&amp;lt;object&amp;gt; cloneable = aCloneable.Clone;
MethodInfo cloneMethod = cloneable.Method;&lt;/pre&gt;
		&lt;p&gt;How do you deal with generic classes, though?&lt;/p&gt;
		&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;public interface IFoo&amp;lt;T&amp;gt;
{
   void Do();
}&lt;/pre&gt;
		&lt;p&gt;In order to get the method, you need to have an actual concrete type of IFoo&amp;lt;T&amp;gt;&lt;strike&gt;, so you can just any type&lt;/strike&gt;:&lt;/p&gt;
		&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;Action doMethod = aFooOfString&lt;strike&gt;((IFoo&amp;lt;string&amp;gt;)null)&lt;/strike&gt;.Do;
MethodInfo doMethodInfo = doMethod.Method;&lt;/pre&gt;
		&lt;p&gt;The same trick applies to generic methods, but you need to get the generic method definition at the end:&lt;/p&gt;
		&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;public static class Factory
{
    public static T Create&amp;lt;T&amp;gt;() { ... }
}
...
Func&amp;lt;string&amp;gt; createMethod = &lt;strike&gt;((IFactory)null)&lt;/strike&gt;Factory.Create&amp;lt;string&amp;gt;;
MethodInfo genericCreate = createMethod.Method.GetGenericMethodDefinition();&lt;/pre&gt;
		&lt;p&gt;With these combined tricks, you don't need to (ab?)use expression trees for certain scenarios and it's backwards compatible with .NET 2.0.&lt;/p&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=164828" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=sAzHyIL1EVQ:jLD7PJoa48A:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=sAzHyIL1EVQ:jLD7PJoa48A:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/sAzHyIL1EVQ" height="1" width="1"/&gt;</content><slash:comments>3</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=164828</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2009/08/10/164828.aspx</feedburner:origLink></entry><entry><title>Extensible Test Assertions With MSTest VSTS</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DanielCazzulino/~3/apoYTPCyHOE/163348.aspx" /><id>e6de741d-39cb-46fc-b8ae-6ce6880bcef9:163348</id><created>2009-07-25T13:44:06Z</created><content type="text/html" mode="escaped">&lt;p&gt;If you have used more than one unit test framework (i.e. &lt;a href="http://xunit.codeplex.com/"&gt;xUnit.NET&lt;/a&gt;, &lt;a href="http://nunit.org"&gt;NUnit&lt;/a&gt;, MSTest/VSTS, etc.), chances are that you’ll miss features from one when using another.&lt;/p&gt; &lt;p&gt;In particular, MSTest/VSTS is lagging behind the crowd as it’s stuck in an &lt;a href="http://nunit.org/index.php?p=documentation"&gt;NUnit circa 2002&lt;/a&gt; (2.0) API for assertions and test attributes. This is what happens when you have a product that has to honor backwards compatibility even at the expense of usability and/or evolution of coding styles and API design.&lt;/p&gt; &lt;p&gt;Compare that with xUnit.NET, which had the luxury of starting from scratch just over a year ago, &lt;a href="http://xunit.codeplex.com/Wiki/View.aspx?title=WhyDidWeBuildXunit"&gt;with all the accumulated learnings&lt;/a&gt; from NUnit and years of TDD work. The one assertion I missed the most from xUnit.NET was Throws:&lt;/p&gt;&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;Assert.Throws&amp;lt;ArgumentNullException&amp;gt;(() =&amp;gt; service.Do(null));&lt;/pre&gt;
&lt;p&gt;Very explicit, highly precise check for an exception being thrown. MSTest, on the other hand, is still stuck in the (now even called a &lt;a href="http://blog.james-carr.org/2006/11/03/tdd-anti-patterns/"&gt;TDD anti-pattern&lt;/a&gt;, “The Secret Catcher”) attribute-based version:&lt;/p&gt;&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;[ExpectedException(typeof(ArgumentNullException))]&lt;br&gt;public void WhenDoReceivesNull_ThenThrowsArgumentNullException()&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp; service.Do(null);&lt;br&gt;}&lt;/pre&gt;
&lt;p&gt;In this case, doesn’t look like a whole lot of difference, but if you have more than a couple lines of code in the test, chances are that the exception can be thrown by someone else in there and you would wrongly believe the test actually passed when it didn’t! &lt;/p&gt;
&lt;p&gt;I also like xUnit.NET dropping the “Is” prefix on all assertions, which has always seemed redundant to me (i.e. &lt;code&gt;Assert.NotNull&lt;/code&gt; vs &lt;code&gt;Assert.IsNotNull&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Finally, with .NET 3.5 came along extension methods, essentially a way to infinitely extend any given interface as needs arise. Even xUnit.NET is lagging a bit there, but such is life for software: become partially obsolete on almost every rev of the underlying platform. Hence, leveraging now this open-ended extensibility mechanism in .NET seems like the obvious choice. And in the process, we would be able to bring in our beloved idioms from our favorite unit test framework.&lt;/p&gt;
&lt;h2&gt;Breeding New Life to MSTest APIs&lt;/h2&gt;
&lt;p&gt;In many projects you just don’t get to decide which test framework will be used. You’re given one. For many .NET developers working on Microsoft-only shops, that’s MSTest/VSTS and you have to live with it. Yes, things like &lt;a href="http://testdriven.net"&gt;TestDriven.NET&lt;/a&gt; can make it run fast (as it should natively) making it bearable. But you still have to use that old-looking API and there’s no easy way to extend it. Or is there?&lt;/p&gt;
&lt;p&gt;As you probably know already, the key to extension methods is to have an actual instance of a type that we can use to hook the extension methods to. Hence, here is IAssertion:&lt;/p&gt;&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;public interface IAssertion
{
}
&lt;/pre&gt;
&lt;p&gt;And a default implementation, which doesn’t need to provide any assertions, as we want all of them to be fully extensible and provided outside of these hook types:&lt;/p&gt;&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;public class Assertion : IAssertion
{
}&lt;/pre&gt;
&lt;p&gt;Now, let’s move on and define some basic assertions for IAssertion:&lt;/p&gt;&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;public static class BasicAssertions
{
    public static void Equal&amp;lt;T&amp;gt;(this IAssertion assertion, T expected, T actual, string message = null, params object[] args)
    {
        Assert.AreEqual&amp;lt;T&amp;gt;(expected, actual, message, args);
    }
    ... others
}
&lt;/pre&gt;
&lt;p&gt;With that in place, we can easily enable this xUnit.NET style assertions quite easily:&lt;/p&gt;&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;[TestClass]
public class FooSpec
{
    static readonly IAssertion Assert = new Assertion();

    [Test]
    public void WhenDo_ThenReturnsFoo()
    {
        var result = foo.Do();

        Assert.Equal("foo", result);
    }
}

&lt;/pre&gt;
&lt;p&gt;Note how the test itself looks just like an xUnit.NET would. You can now get crazy and add whatever helper assertions you want via extension methods on &lt;code&gt;IAssertion&lt;/code&gt;. Also, note how I’m mostly providing usability improvements on top of the underlying MSTest assertions, which is also nice. I’ve added the following two attributes to the assertion classes so that the debugging experience is nicer:&lt;/p&gt;&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;[DebuggerStepThrough]
[DebuggerNonUserCode]
&lt;/pre&gt;
&lt;h2&gt;How C# 4.0 Optional Simplify API Design&lt;/h2&gt;
&lt;p&gt;Current unit test frameworks provide multiple overloads for each assertion, so that you can provide an optional failure message to augment the default assertion failure message (i.e. “Account should be debited but it was not!”, rather than “Expected 0 but was 10”). Additionally, the message might even contain formatting arguments, such as &lt;code&gt;"Should have been {0} but source account remained with a {1} balance", expected, account.Balance&lt;/code&gt;. With C# 4.0 optional parameters we can simplify what would be three overloads (one with no message, one with a fixed message, and one with a message plus formatting arguments) to just one:&lt;/p&gt;&lt;pre class="brush: csharp; gutter: false; toolbar: false;"&gt;public static void Equal&amp;lt;T&amp;gt;(this IAssertion assertion, T expected, T actual, string message = null, params object[] args)
&lt;/pre&gt;
&lt;p&gt;In most cases where overloads just provide increasing amount of arguments that just enable overriding a default value, this new feature in C# 4.0 makes your code (the API but also the consuming code) much more explicit. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Get the assertions code from &lt;a href="https://clarius.svn.codeplex.com/svn/Assertions.txt"&gt;Clarius Labs&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://www.clariusconsulting.net/aggbug.aspx?PostID=163348" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=apoYTPCyHOE:mBYdMuWvyTk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DanielCazzulino?a=apoYTPCyHOE:mBYdMuWvyTk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DanielCazzulino?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DanielCazzulino/~4/apoYTPCyHOE" height="1" width="1"/&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://www.clariusconsulting.net/blogs/kzu/commentrss.aspx?PostID=163348</wfw:commentRss><feedburner:origLink>http://www.clariusconsulting.net/blogs/kzu/archive/2009/07/25/163348.aspx</feedburner:origLink></entry></feed>
