<feed xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
    <title>Brian Laird</title>
    <link rel="self" type="application/xml" href="http://geekswithblogs.net/blaird/Atom.aspx" />
    <subtitle type="html"> My garden isn't on facebook. Semicolon.</subtitle>
    <id>http://geekswithblogs.net/blaird/Default.aspx</id>
    <author>
        <name>Brian</name>
        <uri>http://geekswithblogs.net/blaird/Default.aspx</uri>
    </author>
    <generator uri="http://subtextproject.com" version="Subtext Version 0.0.0.0">Subtext</generator>
    <updated>2010-06-22T08:28:53Z</updated>
    <entry>
        <title>Generics in XML comments</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/blaird/archive/2010/06/22/generics-in-xml-comments.aspx" />
        <id>http://geekswithblogs.net/blaird/archive/2010/06/22/generics-in-xml-comments.aspx</id>
        <published>2010-06-22T08:28:53-05:00:00</published>
        <updated>2010-06-22T08:28:53Z</updated>
        <content type="html">&lt;p&gt;I completely forgot how to reference generic classes within &amp;lt;see/&amp;gt; and &amp;lt;seealso/&amp;gt; tags this morning, call it a total lack of caffeine (which I haven’t had a significant amount of for a month now).&lt;/p&gt;  &lt;p&gt;Figured someone else may have a similar brain fart, so remember it’s curly braces, not &amp;amp;lt; and &amp;amp;gt; tags which made more sense.&lt;/p&gt;  &lt;pre class="code"&gt;    &lt;span style="color: gray"&gt;/// &amp;lt;summary&amp;gt;
    /// &lt;/span&gt;&lt;span style="color: green"&gt;Used by &lt;/span&gt;&lt;span style="color: gray"&gt;&amp;lt;see cref="MyGenericClass{T}"/&amp;gt;&lt;/span&gt;&lt;span style="color: green"&gt;.
    &lt;/span&gt;&lt;span style="color: gray"&gt;/// &amp;lt;/summary&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;And not to go on a tangent, but shouldn’t decaf coffee be at least half the price?&lt;/p&gt;&lt;img src="http://geekswithblogs.net/blaird/aggbug/140550.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/blaird/comments/140550.aspx</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/blaird/comments/commentRss/140550.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/blaird/services/trackbacks/140550.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Tip for Cleaning up Visual Studio Usings</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/blaird/archive/2010/06/18/tip-for-cleaning-up-visual-studio-usings.aspx" />
        <id>http://geekswithblogs.net/blaird/archive/2010/06/18/tip-for-cleaning-up-visual-studio-usings.aspx</id>
        <published>2010-06-18T15:34:35-05:00:00</published>
        <updated>2010-06-18T15:34:35Z</updated>
        <content type="html">&lt;p&gt;I love to keep my class files clean, and often times that means not using the suggested using statements that visual studio inserts for me based on the template. I love the Organize Usings functionality, especially Remove and Sort, but by default there isn't a keyboard chord setup for it.&lt;/p&gt;  &lt;p&gt;When you visit the options for visual studio under Environment &amp;gt;&amp;gt; Keyboard, you'll see all of the possible commands. Typing "Organize" into the filter box will get to what we want. &lt;/p&gt; &lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/blaird/WindowsLiveWriter/TipforCleaningupVisualStudioUsings_DB88/usings-1_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Finding the command" border="0" alt="Finding the command" src="http://geekswithblogs.net/images/geekswithblogs_net/blaird/WindowsLiveWriter/TipforCleaningupVisualStudioUsings_DB88/usings-1_thumb_1.png" width="424" height="252" /&gt;&lt;/a&gt;   &lt;p&gt;Then we just need to assign a shortcut key. Luckily it didn’t take long for me to find a shortcut chord that was available, CTRL+R, CTRL+S. Hold the Control key and type R then S into the shortcut keys box and then click assign (assuming that no other command is using the shortcut in your environment).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/blaird/WindowsLiveWriter/TipforCleaningupVisualStudioUsings_DB88/usings-2_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Setting the keyboard shortcut" border="0" alt="Setting the keyboard shortcut" src="http://geekswithblogs.net/images/geekswithblogs_net/blaird/WindowsLiveWriter/TipforCleaningupVisualStudioUsings_DB88/usings-2_thumb.png" width="424" height="249" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And there you have it. So anytime you make changes or if you just want to clean up a new class just type CTRL+R, CTRL+S and unused usings are removed and the rest are sorted. &lt;/p&gt;  &lt;p&gt;Speaking of shortcuts, I’ll never understand why there isn’t one to close a file by default. I always assign ALT+C to the File.Close command so I can quickly cleanup several open files at a time. &lt;/p&gt;  &lt;p&gt;If anyone has a better way (other than third party tools) I’d love to hear about it. &lt;/p&gt;&lt;img src="http://geekswithblogs.net/blaird/aggbug/140497.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/blaird/comments/140497.aspx</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/blaird/comments/commentRss/140497.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/blaird/services/trackbacks/140497.aspx</trackback:ping>
    </entry>
    <entry>
        <title>OData where art thou?</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/blaird/archive/2010/03/17/odata-where-art-thou.aspx" />
        <id>http://geekswithblogs.net/blaird/archive/2010/03/17/odata-where-art-thou.aspx</id>
        <published>2010-03-17T08:20:42-05:00:00</published>
        <updated>2010-03-17T08:20:42Z</updated>
        <content type="html">&lt;p&gt;Douglas Purdy &lt;a href="http://microsoftontheissues.com/cs/blogs/mscorp/archive/2010/03/16/open-data-for-the-open-web.aspx"&gt;explains&lt;/a&gt;. I think the best part will be the governmental aspect. All public record should be available in a way that’s easy to query IMHO. From the article:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Many of us at Microsoft believe the OData protocol can help usher in a more open and programmable Web by creating a common funnel to expose rich data, thereby creating a world of customized consumer mash-ups; a world where government data is transparent and accessible to any citizen; a world where you can ask a question and know, “There’s a feed for that.” &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Do check out &lt;a href="http://www.odata.org"&gt;www.odata.org&lt;/a&gt;, and while you’re at it, check out &lt;a href="http://pinpoint.microsoft.com/en-US/Dallas"&gt;codename Dallas&lt;/a&gt;. For all those government IT workers out there, consider the savings. No need to pay someone to format the data for a specific department or constituent. Just put it online and point them there. &lt;/p&gt;&lt;img src="http://geekswithblogs.net/blaird/aggbug/138574.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/blaird/comments/138574.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/blaird/comments/commentRss/138574.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/blaird/services/trackbacks/138574.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Basic WCF Unit Testing</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/blaird/archive/2010/03/16/basic-wcf-unit-testing.aspx" />
        <id>http://geekswithblogs.net/blaird/archive/2010/03/16/basic-wcf-unit-testing.aspx</id>
        <published>2010-03-16T15:45:03-05:00:00</published>
        <updated>2010-03-17T08:08:55Z</updated>
        <content type="html">&lt;p&gt;Coming from someone who loves the KISS method, I was surprised to find that I was making something entirely too complicated. I know, shocker right? &lt;/p&gt;  &lt;p&gt;Now I'm no unit testing ninja, and not really a WCF ninja either, but had a desire to test service calls without a) going to a database, or b) making sure that the entire WCF infrastructure was tip top. Who does? It's not the environment I want to test, just the logic I’ve written to ensure there aren't any side effects. &lt;/p&gt;  &lt;p&gt;So, for the K.I.S.S. method: &lt;/p&gt;  &lt;p&gt;Assuming that you're using a WCF service library (you are using service libraries correct?), it's really as easy as referencing the service library, then building out some stubs for bunking up data.&lt;/p&gt;  &lt;h4&gt;The data contract&lt;/h4&gt;  &lt;p&gt;I’ve used the default “CompositeType” that is in the template, handy only for examples like this. I’ve added an Id property and overridden ToString and Equals.&lt;/p&gt;  &lt;pre class="code"&gt;[&lt;span style="color: #2b91af"&gt;DataContract&lt;/span&gt;]
&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CompositeType
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;bool &lt;/span&gt;boolValue = &lt;span style="color: blue"&gt;true&lt;/span&gt;;
    &lt;span style="color: blue"&gt;string &lt;/span&gt;stringValue = &lt;span style="color: #a31515"&gt;"Hello "&lt;/span&gt;;

    [&lt;span style="color: #2b91af"&gt;DataMember&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public int &lt;/span&gt;Id { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }

    [&lt;span style="color: #2b91af"&gt;DataMember&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public bool &lt;/span&gt;BoolValue
    {
        &lt;span style="color: blue"&gt;get &lt;/span&gt;{ &lt;span style="color: blue"&gt;return &lt;/span&gt;boolValue; }
        &lt;span style="color: blue"&gt;set &lt;/span&gt;{ boolValue = &lt;span style="color: blue"&gt;value&lt;/span&gt;; }
    }

    [&lt;span style="color: #2b91af"&gt;DataMember&lt;/span&gt;]
    &lt;span style="color: blue"&gt;public string &lt;/span&gt;StringValue
    {
        &lt;span style="color: blue"&gt;get &lt;/span&gt;{ &lt;span style="color: blue"&gt;return &lt;/span&gt;stringValue; }
        &lt;span style="color: blue"&gt;set &lt;/span&gt;{ stringValue = &lt;span style="color: blue"&gt;value&lt;/span&gt;; }
    }

    &lt;span style="color: blue"&gt;public override bool &lt;/span&gt;Equals(&lt;span style="color: blue"&gt;object &lt;/span&gt;obj)
    {
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(&lt;span style="color: blue"&gt;null &lt;/span&gt;!= obj &amp;amp;&amp;amp; obj &lt;span style="color: blue"&gt;is &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CompositeType&lt;/span&gt;)
        {
            &lt;span style="color: blue"&gt;var &lt;/span&gt;o = obj &lt;span style="color: blue"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CompositeType&lt;/span&gt;;
            &lt;span style="color: blue"&gt;return &lt;/span&gt;Id == o.Id &amp;amp;&amp;amp; BoolValue == o.BoolValue &amp;amp;&amp;amp; StringValue == o.StringValue;
        }
        &lt;span style="color: blue"&gt;return false&lt;/span&gt;; 
    }

    &lt;span style="color: blue"&gt;public override string &lt;/span&gt;ToString()
    {
        &lt;span style="color: blue"&gt;return string&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"Id:{0};BoolValue:{1};StringValue:{2};"&lt;/span&gt;,
            Id, BoolValue, StringValue); 
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;h4&gt;The service contract&lt;/h4&gt;

&lt;p&gt;We’ll use a very basic service contract, just for getting and updating an entity. &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;pre class="code"&gt;[&lt;span style="color: #2b91af"&gt;ServiceContract&lt;/span&gt;]
&lt;span style="color: blue"&gt;public interface &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IMyService
&lt;/span&gt;{
    [&lt;span style="color: #2b91af"&gt;OperationContract&lt;/span&gt;]
    &lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;GetCompositeType(&lt;span style="color: blue"&gt;int &lt;/span&gt;id);

    [&lt;span style="color: #2b91af"&gt;OperationContract&lt;/span&gt;]
    &lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;SaveCompositeType(&lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;item);

    [&lt;span style="color: #2b91af"&gt;OperationContract&lt;/span&gt;]
    &lt;span style="color: #2b91af"&gt;CompositeTypeCollection &lt;/span&gt;GetAllCompositeTypes();
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;h4&gt;The implementation&lt;/h4&gt;

&lt;p&gt;When I implement the service, I want to be able to send known data into it so I don’t have to fuss around with database access or the like. To do this, I first have to create an interface for my data access: &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public interface &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IMyServiceDataManager
&lt;/span&gt;{
    &lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;GetCompositeType(&lt;span style="color: blue"&gt;int &lt;/span&gt;id);
    &lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;SaveCompositeType(&lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;item);
    &lt;span style="color: #2b91af"&gt;CompositeTypeCollection &lt;/span&gt;GetAllCompositeTypes();
}&lt;/pre&gt;

&lt;p&gt;For the purposes of this we can ignore our implementation of the IMyServiceDataManager interface inside of the service. Pretend it uses LINQ to Entities to map its data, or maybe it goes old school and uses EntLib to talk to SQL. Maybe it talks to a tape spool on a mainframe on the third floor. It really doesn’t matter. That’s the point. &lt;/p&gt;

&lt;p&gt;So here’s what our service looks like in its most basic form: &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;GetCompositeType(&lt;span style="color: blue"&gt;int &lt;/span&gt;id)
{
    &lt;span style="color: green"&gt;//sanity checks 
    &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(id == 0) &lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ArgumentException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"id cannot be zero."&lt;/span&gt;); 
    &lt;span style="color: blue"&gt;return &lt;/span&gt;_dataManager.GetCompositeType(id); 
}

&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;SaveCompositeType(&lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;item)
{
    &lt;span style="color: blue"&gt;return &lt;/span&gt;_dataManager.SaveCompositeType(item); 
}

&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CompositeTypeCollection &lt;/span&gt;GetAllCompositeTypes()
{
    &lt;span style="color: blue"&gt;return &lt;/span&gt;_dataManager.GetAllCompositeTypes();
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;But what about the datamanager? The constructor takes care of that. I don’t want to expose any testing ability in release (or the ability for someone to swap out my datamanager) so this is what we get: &lt;/p&gt;

&lt;pre class="code"&gt;        &lt;span style="color: #2b91af"&gt;IMyServiceDataManager &lt;/span&gt;_dataManager;

        &lt;span style="color: blue"&gt;public &lt;/span&gt;MyService()
        {
            _dataManager = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MyServiceDataManager&lt;/span&gt;();
        }

&lt;span style="color: blue"&gt;#if &lt;/span&gt;DEBUG
        &lt;span style="color: blue"&gt;public &lt;/span&gt;MyService(&lt;span style="color: #2b91af"&gt;IMyServiceDataManager &lt;/span&gt;dataManager)
        {
            _dataManager = dataManager;
        }
&lt;span style="color: blue"&gt;#endif
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;h4&gt;The Stub&lt;/h4&gt;

&lt;p&gt;Now it’s time for the rubber to meet the road… Like most guys that ever talk about unit testing here’s a sample that is painting in *very* broad strokes. The important part however is that within the test project, I’ve created a bunk (unit testing purists would say stub I believe) object that implements my IMyServiceDataManager so that I can deal with known data. Here it is: &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;internal class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FakeMyServiceDataManager &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;IMyServiceDataManager
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;internal &lt;/span&gt;FakeMyServiceDataManager()
    {
        Collection = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CompositeTypeCollection&lt;/span&gt;();
        Collection.AddRange(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CompositeTypeCollection &lt;/span&gt;{
            &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;{ Id = 1, BoolValue = &lt;span style="color: blue"&gt;true&lt;/span&gt;, StringValue = &lt;span style="color: #a31515"&gt;"foo 1"&lt;/span&gt;, },
            &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;{ Id = 2, BoolValue = &lt;span style="color: blue"&gt;false&lt;/span&gt;, StringValue = &lt;span style="color: #a31515"&gt;"foo 2"&lt;/span&gt;, },
            &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;{ Id = 3, BoolValue = &lt;span style="color: blue"&gt;true&lt;/span&gt;, StringValue = &lt;span style="color: #a31515"&gt;"foo 3"&lt;/span&gt;, },
        });
    }
    &lt;span style="color: #2b91af"&gt;CompositeTypeCollection &lt;/span&gt;Collection { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }
        
    &lt;span style="color: blue"&gt;#region &lt;/span&gt;IMyServiceDataManager Members

    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;GetCompositeType(&lt;span style="color: blue"&gt;int &lt;/span&gt;id)
    {
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(id &amp;lt;= 0) &lt;span style="color: blue"&gt;return null&lt;/span&gt;;
        &lt;span style="color: blue"&gt;return &lt;/span&gt;Collection.SingleOrDefault(m =&amp;gt; m.Id == id); 
    }
    
    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;SaveCompositeType(&lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;item)
    {            
        &lt;span style="color: blue"&gt;var &lt;/span&gt;existing = Collection.SingleOrDefault(m =&amp;gt; m.Id == item.Id);
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(&lt;span style="color: blue"&gt;null &lt;/span&gt;!= existing)
        {
            Collection.Remove(existing);
        }        
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(item.Id == 0)
        {
            item.Id = Collection.Count &amp;gt; 0 ? Collection.Max(m =&amp;gt; m.Id) + 1 : 1;
        }    
        Collection.Add(item);
        &lt;span style="color: blue"&gt;return &lt;/span&gt;item; 
    }

    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CompositeTypeCollection &lt;/span&gt;GetAllCompositeTypes()
    {
        &lt;span style="color: blue"&gt;return &lt;/span&gt;Collection;
    }

    &lt;span style="color: blue"&gt;#endregion
&lt;/span&gt;}&lt;/pre&gt;

&lt;p&gt;So it’s tough to see in this example why any of this is necessary, but in a real world application you would/should/could be applying much more logic within your service implementation. This all serves to ensure that between refactorings etc, that it doesn’t send sparking cogs all about or let the blue smoke out. Here’s a simple test that brings it all home, remember, broad strokes: &lt;/p&gt;

&lt;pre class="code"&gt;[&lt;span style="color: #2b91af"&gt;TestMethod&lt;/span&gt;]
&lt;span style="color: blue"&gt;public void &lt;/span&gt;MyService_GetCompositeType_ExpectedValues()
{
    &lt;span style="color: #2b91af"&gt;FakeMyServiceDataManager &lt;/span&gt;fake = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FakeMyServiceDataManager&lt;/span&gt;();
    &lt;span style="color: #2b91af"&gt;MyService &lt;/span&gt;service = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MyService&lt;/span&gt;(fake);
    &lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;expected = fake.GetCompositeType(1);
    &lt;span style="color: #2b91af"&gt;CompositeType &lt;/span&gt;actual = service.GetCompositeType(1);

    &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual&amp;lt;&lt;span style="color: #2b91af"&gt;CompositeType&lt;/span&gt;&amp;gt;(expected, actual, &lt;span style="color: #a31515"&gt;"Objects are not equal. Expected: {0}; Actual: {1};"&lt;/span&gt;, expected, actual);
}&lt;/pre&gt;

&lt;h4&gt;Summary&lt;/h4&gt;

&lt;p&gt;That’s really all there is to it. You could use software x or framework y to do the exact same thing, but in my case I just didn’t really feel like it. This speaks volumes to my not yet ninja unit testing prowess.&lt;/p&gt;&lt;img src="http://geekswithblogs.net/blaird/aggbug/138559.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/blaird/comments/138559.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/blaird/comments/commentRss/138559.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/blaird/services/trackbacks/138559.aspx</trackback:ping>
    </entry>
    <entry>
        <title>w00t! First post!</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/blaird/archive/2010/03/12/w00t-first-post.aspx" />
        <id>http://geekswithblogs.net/blaird/archive/2010/03/12/w00t-first-post.aspx</id>
        <published>2010-03-12T14:17:42-06:00:00</published>
        <updated>2010-03-12T14:54:24Z</updated>
        <content type="html">&lt;p&gt;So, I busted my old blog and hadn't been keeping up with it. Decided it would be easier on me to use software that I didn't maintain, so several months ago I signed up for a GWB account. You are a witness to procrastination at its finest! &lt;/p&gt;
&lt;p&gt;I was remarking to my friend Abby that I hadn't written anything in ages, that I've typed a bunch in the last 5 years or so, but that the typing belonged to someone else as work product, was boring technical mumbo jumbo, or was only good before it spoiled, that project/job/technology/tweet based freshness window that us geeks have to deal with. In short, I just didn't feel like it. So forgive the rambling sentences and my grammatical failures, you have Abby to thank ;)&lt;/p&gt;
&lt;p&gt;On the technology front I've been working with WPF, WCF and a whole lot of other alphabet soup in terms of patterns. I'm starting to get spoiled on Visual Studio 2010, and may have made a mistake by evaluating the ultimate version. &lt;/p&gt;
&lt;p&gt;Because I'm a .NET geek and an outdoor geek, expect a hodgepodge. It's nearly Easter, which for the garden means a whole lot of things. I've already started getting seed out, and started working soil. It feels good to get real dirt on your hands.&lt;/p&gt;&lt;img src="http://geekswithblogs.net/blaird/aggbug/138488.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/blaird/comments/138488.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/blaird/comments/commentRss/138488.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/blaird/services/trackbacks/138488.aspx</trackback:ping>
    </entry>
</feed>
