<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Infinity &#187; .NET</title>
	<atom:link href="http://blog.cyragon.com/tag/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.cyragon.com</link>
	<description>where it all begins</description>
	<lastBuildDate>Fri, 11 Feb 2011 20:26:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>C# vs Java: casting objects and calling members</title>
		<link>http://blog.cyragon.com/2011/02/c-vs-java-casting-objects-and-calling-members/</link>
		<comments>http://blog.cyragon.com/2011/02/c-vs-java-casting-objects-and-calling-members/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 20:24:00 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Interesting]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.cyragon.com/?p=210</guid>
		<description><![CDATA[Given these two functionally identical code samples in c# and java, what is the output? C#: public class A { &#160;&#160;public String Method() &#160;&#160;{ &#160;&#160;&#160;&#160;return &#34;this is A&#34;; &#160;&#160;} } public class B : A { &#160;&#160;public String Method() &#160;&#160;{ &#160;&#160;&#160;&#160;return &#34;this is B&#34;; &#160;&#160;} } A thisA = new B(); thisA.Method(); Java: public class [...]]]></description>
			<content:encoded><![CDATA[<p>Given these two functionally identical code samples in c# and java, what is the output?</p>
<p>C#:<br />
<pre><code>public class A
{
&nbsp;&nbsp;public String Method()
&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;return &quot;this is A&quot;;
&nbsp;&nbsp;}
}

public class B : A
{
&nbsp;&nbsp;public String Method()
&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;return &quot;this is B&quot;;
&nbsp;&nbsp;}
}

A thisA = new B();

thisA.Method();</code></pre></p>
<p>Java:<br />
<pre><code>public class A
{
&nbsp;&nbsp;public String Method()
&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;return &quot;this is A&quot;;
&nbsp;&nbsp;}
}

public class B extends A
{
&nbsp;&nbsp;public String Method()
&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;return &quot;this is B&quot;;
&nbsp;&nbsp;}
}

A thisA = new B();

thisA.Method();</code></pre></p>
<p>What does thisA.Method() return? </p>
<p>It turns out that there are two different answers to this. In .NET/C# it returns from A (&#8220;this is A&#8221;). In Java, it returns from B (&#8220;this is B&#8221;). </p>
<p>So far it appears that this is a type issue; new B() must be getting cast back to A in C#. Looking for some documentation on this specifically. Links anyone?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyragon.com/2011/02/c-vs-java-casting-objects-and-calling-members/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Coping contents of Template Column in data grid to clipboard</title>
		<link>http://blog.cyragon.com/2010/08/coping-contents-of-template-column-in-data-grid-to-clipboard/</link>
		<comments>http://blog.cyragon.com/2010/08/coping-contents-of-template-column-in-data-grid-to-clipboard/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 21:12:25 +0000</pubDate>
		<dc:creator>Ben Farmer</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://blog.cyragon.com/?p=187</guid>
		<description><![CDATA[There are some nice new features (coming from Silverlight 2) in the latest versions of Silverlight &#8211; being able to copy rows in a DataGrid via the familiar Control+C for instance. But I noticed something strange: some columns were blank when I pasted them into Excel (or notepad). The blank columns were always DataGridTemplateColumn and [...]]]></description>
			<content:encoded><![CDATA[<p>There are some nice new features (coming from Silverlight 2) in the latest versions of Silverlight &#8211; being able to copy rows in a DataGrid via the familiar Control+C for instance. </p>
<p>But I noticed something strange: some columns were blank when I pasted them into Excel (or notepad). The blank columns were always DataGridTemplateColumn and that made sense. How could it know what to copy from one or more controls? </p>
<p>Turns out this is really easy to fix if you are using data binding. All you have to do is bind the ClipboardContentBinding property on the DataGridTemplateColumn with the value you want copied for this column.</p>
<p>For example:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p187code2'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1872"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p187code2"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;data:DataGridTemplateColumn</span> <span style="color: #000066;">Header</span>=<span style="color: #ff0000;">&quot;Name&quot;</span> <span style="color: #000066;">ClipboardContentBinding</span>=<span style="color: #ff0000;">&quot;{Binding Name}&quot;</span> <span style="color: #000066;">SortMemberPath</span>=<span style="color: #ff0000;">&quot;Name&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;data:DataGridTemplateColumn.CellTemplate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;DataTemplate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;HyperlinkButton</span> <span style="color: #000066;">Content</span>=<span style="color: #ff0000;">&quot;{Binding Name}&quot;</span> <span style="color: #000066;">Margin</span>=<span style="color: #ff0000;">&quot;3&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/DataTemplate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/data:DataGridTemplateColumn.CellTemplate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/data:DataGridTemplateColumn<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>And that&#8217;s it. Control+C copy works as desired.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyragon.com/2010/08/coping-contents-of-template-column-in-data-grid-to-clipboard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CodeStock 2010: Chaos to Awesome</title>
		<link>http://blog.cyragon.com/2010/06/codestock-2010-chaos-to-awesome/</link>
		<comments>http://blog.cyragon.com/2010/06/codestock-2010-chaos-to-awesome/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 13:00:07 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[CodeStock]]></category>

		<guid isPermaLink="false">http://blog.cyragon.com/?p=183</guid>
		<description><![CDATA[We&#8217;ll be posting our notes and slidedeck a bit later, but here are some of the resources we talked about in the presentation. VisualSVN Server: http://www.visualsvn.com/server/ Ankh SVN (plugin for Visual Studio): http://ankhsvn.open.collab.net/ Hudson Continuous Integration: http://hudson-ci.org/ Fitnesse (.NET/SLiM): http://www.fitnesse.org/ and http://www.fitnesse.org/FitNesse.DotNet You can always message us on twitter @jwcarroll and @benfarmer.]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ll be posting our notes and slidedeck a bit later, but here are some of the resources we talked about in the presentation.</p>
<p>VisualSVN Server: <a href="http://www.visualsvn.com/server/">http://www.visualsvn.com/server/</a><br />
Ankh SVN (plugin for Visual Studio): <a href="http://ankhsvn.open.collab.net/">http://ankhsvn.open.collab.net/</a></p>
<p>Hudson Continuous Integration: <a href="http://hudson-ci.org/">http://hudson-ci.org/</a></p>
<p>Fitnesse (.NET/SLiM): <a href="http://www.fitnesse.org">http://www.fitnesse.org/</a> and <a href="http://www.fitnesse.org/FitNesse.DotNet">http://www.fitnesse.org/FitNesse.DotNet</a></p>
<p>You can always message us on twitter <a href="http://twitter.com/jwcarroll">@jwcarroll</a> and <a href="http://twitter.com/benfarmer">@benfarmer</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyragon.com/2010/06/codestock-2010-chaos-to-awesome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extending Moq&#8217;s Setup() to return multiple values</title>
		<link>http://blog.cyragon.com/2010/06/extending-moqs-setup-to-return-multiple-values/</link>
		<comments>http://blog.cyragon.com/2010/06/extending-moqs-setup-to-return-multiple-values/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 20:37:35 +0000</pubDate>
		<dc:creator>jwcarroll</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Moq]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://blog.cyragon.com/?p=134</guid>
		<description><![CDATA[If you regularly use TDD, then you are familiar with the concept of mocking. If you don&#8217;t use TDD, then you need to slap yourself and apologize to Bob Martin, Michael Feathers and Ron Jeffries immediately. I&#8217;ll wait here&#8230; While I would argue you should begin your TDD journey by writing your own mocks; using a framework [...]]]></description>
			<content:encoded><![CDATA[<p>If you regularly use <a href="http://en.wikipedia.org/wiki/Test-driven_development">TDD</a>, then you are familiar with the concept of mocking. If you don&#8217;t use TDD, then you need to slap yourself and apologize to <a href="http://www.objectmentor.com/omTeam/martin_r.html">Bob Martin</a>, <a href="http://www.objectmentor.com/omTeam/feathers_m.html">Michael Feathers</a> and <a href="http://www.objectmentor.com/omTeam/jeffries_r.html">Ron Jeffries</a> immediately. I&#8217;ll wait here&#8230;</p>
<p>While I would argue you should begin your TDD journey by <a href="http://blog.objectmentor.com/articles/2009/10/28/manual-mocking-resisting-the-invasion-of-dots-and-parentheses">writing your own mocks</a>; using a framework will certainly make like easier in many instances and allow you to focus on the tests themselves.</p>
<p>I was a <a href="http://www.ayende.com/projects/rhino-mocks.aspx">RhinoMocks</a> guy for a long time, but have recently converted to <a href="http://code.google.com/p/moq/">Moq</a>&#8230; AND I LOVE IT!!! Moq is simple and easy to use, and doesn&#8217;t get in the way of the intent of your tests. That being said, there are certain scenarios you run into with any framework that you end up coding around, and sometimes that <em>does</em> get in the way of your what you trying to say with your test.</p>
<p>Moq allows for a pretty simple syntax when you want to set up a return value on a mocked type.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p134code11'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p13411"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p134code11"><pre class="csharp" style="font-family:monospace;">var mockService <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Mock<span style="color: #008000;">&lt;</span>IReturnStuff<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
mockService<span style="color: #008000;">.</span><span style="color: #0000FF;">Setup</span><span style="color: #008000;">&#40;</span>svc <span style="color: #008000;">=&gt;</span> svc<span style="color: #008000;">.</span><span style="color: #0000FF;">SomeMethodCall</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Returns</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Hello, World!&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p>
Pretty sweet so far, and that works 99% of the time. But&#8230; what about a scenario where we want to return different values on successive calls to that method. I can think of a lot of situations where, in the absence of formal eventing, you want your code to test some value until it meets a certain criteria. You might be polling a web service for status updates, or checking a database to see if a record has been written. Whatever the case may be, it <em>will</em> come up.</p>
<p>So, for illustration purposes, let&#8217;s make up one such example. Suppose we wanted to ask a service for a specified set of values, but the return types could be varied. Perhaps we only care about some subset of those values, and want to test that our code correctly deals with variable data.</p>
<p>We have our service contract:<br />
</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p134code12'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p13412"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p134code12"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">interface</span> IReturnStuff
<span style="color: #008000;">&#123;</span>
    <span style="color: #6666cc; font-weight: bold;">String</span> ReturnAString<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>
Next we have our consuming class (the subject under test):<br />
</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p134code13'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p13413"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code" id="p134code13"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> UsesReturnedStuff
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> IReturnStuff ReturnStuff <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> Regex Filter <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> UsesReturnedStuff<span style="color: #008000;">&#40;</span>IReturnStuff returnStuff<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        ReturnStuff <span style="color: #008000;">=</span> returnStuff<span style="color: #008000;">;</span>
        Filter <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Regex<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;(the|quick|brown|fox|hello|world)(:Pu)?&quot;</span>, RegexOptions<span style="color: #008000;">.</span><span style="color: #0000FF;">IgnoreCase</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> List<span style="color: #008000;">&lt;</span><span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">&gt;</span> GetStuff<span style="color: #008000;">&#40;</span>Int32 times<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        var stuff <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> List<span style="color: #008000;">&lt;</span><span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">for</span> <span style="color: #008000;">&#40;</span>var i <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&lt;</span> times<span style="color: #008000;">;</span> i<span style="color: #008000;">++</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            var newStuff <span style="color: #008000;">=</span> ReturnStuff<span style="color: #008000;">.</span><span style="color: #0000FF;">ReturnAString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF; font-weight: bold;">if</span><span style="color: #008000;">&#40;</span>Filter<span style="color: #008000;">.</span><span style="color: #0000FF;">IsMatch</span><span style="color: #008000;">&#40;</span>newStuff<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                stuff<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>newStuff<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">return</span> stuff<span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>
As you can see we have a pretty basic setup here that uses a white-list approach to building up a list. We want to write some tests to mock this behavior. If we wanted two different return values when this method is called, we might instinctively write a test like this:<br />
</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p134code14'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p13414"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p134code14"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>Test<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> LastSetupWins<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
var mockReturnStuff <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Mock<span style="color: #008000;">&lt;</span>IReturnStuff<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
var usesStuff <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> UsesReturnedStuff<span style="color: #008000;">&#40;</span>mockReturnStuff<span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">Object</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
mockReturnStuff<span style="color: #008000;">.</span><span style="color: #0000FF;">Setup</span><span style="color: #008000;">&#40;</span>svc <span style="color: #008000;">=&gt;</span> svc<span style="color: #008000;">.</span><span style="color: #0000FF;">ReturnAString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Returns</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Hello&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
mockReturnStuff<span style="color: #008000;">.</span><span style="color: #0000FF;">Setup</span><span style="color: #008000;">&#40;</span>svc <span style="color: #008000;">=&gt;</span> svc<span style="color: #008000;">.</span><span style="color: #0000FF;">ReturnAString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Returns</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;World!&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
var stuff <span style="color: #008000;">=</span> usesStuff<span style="color: #008000;">.</span><span style="color: #0000FF;">GetStuff</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">2</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Hello World!&quot;</span>, <span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Join</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot; &quot;</span>, stuff<span style="color: #008000;">.</span><span style="color: #0000FF;">ToArray</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>
If you couldn&#8217;t already tell from the name of the test method, this won&#8217;t work as the last return value to be Setup wins. The output from this test will produce the text:</p>
<blockquote><p>&#8220;World! World!&#8221;</p></blockquote>
<p>Not so great, but the Moq documentation gives us a workaround by using a callback method. A little bit of refactoring and Voila!<br />
</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p134code15'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p13415"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code" id="p134code15"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>Test<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> SetupWithCallback<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    var mockReturnStuff <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Mock<span style="color: #008000;">&lt;</span>IReturnStuff<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    var usesStuff <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> UsesReturnedStuff<span style="color: #008000;">&#40;</span>mockReturnStuff<span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">Object</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    var returnValues <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#123;</span><span style="color: #666666;">&quot;Hello&quot;</span>, <span style="color: #666666;">&quot;World!&quot;</span><span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
    var numCalls <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span>
&nbsp;
    mockReturnStuff<span style="color: #008000;">.</span><span style="color: #0000FF;">Setup</span><span style="color: #008000;">&#40;</span>svc <span style="color: #008000;">=&gt;</span> svc<span style="color: #008000;">.</span><span style="color: #0000FF;">ReturnAString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">.</span><span style="color: #0000FF;">Returns</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">=&gt;</span> returnValues<span style="color: #008000;">&#91;</span>numCalls<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">.</span><span style="color: #0000FF;">Callback</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">=&gt;</span> numCalls<span style="color: #008000;">++</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    var stuff <span style="color: #008000;">=</span> usesStuff<span style="color: #008000;">.</span><span style="color: #0000FF;">GetStuff</span><span style="color: #008000;">&#40;</span>returnValues<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Hello World!&quot;</span>, <span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Join</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot; &quot;</span>, stuff<span style="color: #008000;">.</span><span style="color: #0000FF;">ToArray</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>
Here we are taking advantage of anonymous methods and closures to essentially keep feeding our Mock service it&#8217;s next value. This works, but&#8230; yuck! Reading this test is not very clear, and it gets in the way of the intent.<br />
Since we are supposed to refactor our test code too, lets move the ugly bits out into a private method, and re-write our test again.<br />
</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p134code16'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p13416"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code" id="p134code16"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> Int32 SetupMany<span style="color: #008000;">&#40;</span>Mock<span style="color: #008000;">&lt;</span>IReturnStuff<span style="color: #008000;">&gt;</span> mock, Expression<span style="color: #008000;">&lt;</span>Func<span style="color: #008000;">&lt;</span>IReturnStuff, <span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">&gt;&gt;</span> expression, <span style="color: #0600FF; font-weight: bold;">params</span> <span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> args<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    var numCalls <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span>
&nbsp;
    mock<span style="color: #008000;">.</span><span style="color: #0000FF;">Setup</span><span style="color: #008000;">&#40;</span>expression<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">.</span><span style="color: #0000FF;">Returns</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">=&gt;</span> args<span style="color: #008000;">&#91;</span>numCalls<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">.</span><span style="color: #0000FF;">Callback</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">=&gt;</span> numCalls<span style="color: #008000;">++</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">return</span> args<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #008000;">&#91;</span>Test<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> SetupWithExtractedMethod<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    var mockReturnStuff <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Mock<span style="color: #008000;">&lt;</span>IReturnStuff<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    var usesStuff <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> UsesReturnedStuff<span style="color: #008000;">&#40;</span>mockReturnStuff<span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">Object</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    var calls <span style="color: #008000;">=</span> SetupMany<span style="color: #008000;">&#40;</span>mockReturnStuff,
                          svc <span style="color: #008000;">=&gt;</span> svc<span style="color: #008000;">.</span><span style="color: #0000FF;">ReturnAString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>,
                          <span style="color: #666666;">&quot;Hello&quot;</span>, <span style="color: #666666;">&quot;World!&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    var stuff <span style="color: #008000;">=</span> usesStuff<span style="color: #008000;">.</span><span style="color: #0000FF;">GetStuff</span><span style="color: #008000;">&#40;</span>calls<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Hello World!&quot;</span>, <span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Join</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot; &quot;</span>, stuff<span style="color: #008000;">.</span><span style="color: #0000FF;">ToArray</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>
This is good. We haven&#8217;t lost any functionality, but the intent of the test is much clearer. There is less friction because you can read the code and understand what it is doing pretty quickly without having to &#8220;decipher&#8221; the meaning.<br />
Now, this is all fine and good, but I am likely to run into this same scenario more than once. What I would really love to have is a SetupMany() method that was built into Moq. A method I could call directly on the mocked object. Well&#8230; starting with C# 3.0 Extension Methods give us the ability to do just that. With a little work, we should be able to create a very generic extension to give us the desired behavior.<br />
</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p134code17'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p13417"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code" id="p134code17"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> MoqExtensions
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> SetupMany<span style="color: #008000;">&lt;</span>TSvc, TReturn<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span> Mock<span style="color: #008000;">&lt;</span>TSvc<span style="color: #008000;">&gt;</span> mock,
        Expression<span style="color: #008000;">&lt;</span>Func<span style="color: #008000;">&lt;</span>TSvc, TReturn<span style="color: #008000;">&gt;&gt;</span> expression,
        <span style="color: #0600FF; font-weight: bold;">params</span> TReturn<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> args<span style="color: #008000;">&#41;</span>
        <span style="color: #0600FF; font-weight: bold;">where</span> TSvc <span style="color: #008000;">:</span> <span style="color: #6666cc; font-weight: bold;">class</span>
    <span style="color: #008000;">&#123;</span>
        var numCalls <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span>
&nbsp;
        mock<span style="color: #008000;">.</span><span style="color: #0000FF;">Setup</span><span style="color: #008000;">&#40;</span>expression<span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">.</span><span style="color: #0000FF;">Returns</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">=&gt;</span> numCalls <span style="color: #008000;">&lt;</span> args<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span> <span style="color: #008000;">?</span> args<span style="color: #008000;">&#91;</span>numCalls<span style="color: #008000;">&#93;</span> <span style="color: #008000;">:</span> args<span style="color: #008000;">&#91;</span>args<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span> <span style="color: #008000;">-</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">.</span><span style="color: #0000FF;">Callback</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">=&gt;</span> numCalls<span style="color: #008000;">++</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>
Ok, so I know the method signature looks pretty scary. Just don&#8217;t stare at it long enough or you will go blind! The extra bit with the Ternary operator is a bit of error checking to prevent you from running over the bounds of the array. If you call the method more times than available arguments, it will simply keep returning the last argument in the list.<br />
Refactoring our test one last time gives us an even cleaner syntax that works with any return type. The second test merely demonstrates the &#8220;sticky&#8221; final value being returned over and over.<br />
</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p134code18'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p13418"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code" id="p134code18"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>Test<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> SetupWithGenericExtensionMethod<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    var mockReturnStuff <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Mock<span style="color: #008000;">&lt;</span>IReturnStuff<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    var usesStuff <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> UsesReturnedStuff<span style="color: #008000;">&#40;</span>mockReturnStuff<span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">Object</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    mockReturnStuff<span style="color: #008000;">.</span><span style="color: #0000FF;">SetupMany</span><span style="color: #008000;">&#40;</span>svc <span style="color: #008000;">=&gt;</span> svc<span style="color: #008000;">.</span><span style="color: #0000FF;">ReturnAString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>, <span style="color: #666666;">&quot;Hello&quot;</span>, <span style="color: #666666;">&quot;World!&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    var stuff <span style="color: #008000;">=</span> usesStuff<span style="color: #008000;">.</span><span style="color: #0000FF;">GetStuff</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">2</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Hello World!&quot;</span>, <span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Join</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot; &quot;</span>, stuff<span style="color: #008000;">.</span><span style="color: #0000FF;">ToArray</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #008000;">&#91;</span>Test<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> SetupWithLotsOfParams<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    var mockReturnStuff <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Mock<span style="color: #008000;">&lt;</span>IReturnStuff<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    var usesStuff <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> UsesReturnedStuff<span style="color: #008000;">&#40;</span>mockReturnStuff<span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">Object</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    mockReturnStuff<span style="color: #008000;">.</span><span style="color: #0000FF;">SetupMany</span><span style="color: #008000;">&#40;</span>svc <span style="color: #008000;">=&gt;</span> svc<span style="color: #008000;">.</span><span style="color: #0000FF;">ReturnAString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>,
                              <span style="color: #666666;">&quot;the&quot;</span>,<span style="color: #666666;">&quot;quick&quot;</span>,<span style="color: #666666;">&quot;brown&quot;</span>,<span style="color: #666666;">&quot;fox&quot;</span>,<span style="color: #666666;">&quot;jumps&quot;</span>,<span style="color: #666666;">&quot;over&quot;</span>,<span style="color: #666666;">&quot;the&quot;</span>,<span style="color: #666666;">&quot;fence&quot;</span>,<span style="color: #666666;">&quot;hello!&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    var stuff <span style="color: #008000;">=</span> usesStuff<span style="color: #008000;">.</span><span style="color: #0000FF;">GetStuff</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">11</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;the quick brown fox the hello! hello! hello!&quot;</span>, <span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Join</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot; &quot;</span>, stuff<span style="color: #008000;">.</span><span style="color: #0000FF;">ToArray</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>
And there you have it. Extending the Moq API without having to actually go in and modify the source. Hopefully this will save you a headache or two in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyragon.com/2010/06/extending-moqs-setup-to-return-multiple-values/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CodeStock 2010</title>
		<link>http://blog.cyragon.com/2010/03/codestock-2010/</link>
		<comments>http://blog.cyragon.com/2010/03/codestock-2010/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 15:45:06 +0000</pubDate>
		<dc:creator>Ben Farmer</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[CodeStock]]></category>

		<guid isPermaLink="false">http://blog.cyragon.com/?p=132</guid>
		<description><![CDATA[My good friend Josh Carroll and I have submitted a session to CodeStock about practicing Agile on small software development teams. Sign up and vote for our session! Chaos to Awesome in 60 minutes / the heart of Agile without all the fluff Track / Area: Developer / Methodology Technology: Agile, CI, testing, development processes, [...]]]></description>
			<content:encoded><![CDATA[<p>My good friend Josh Carroll and I have submitted a session to CodeStock about practicing Agile on small software development teams. Sign up and vote for our session!</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Chaos to Awesome in 60 minutes / the heart of Agile without all the fluff</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Track / Area: Developer / Methodology</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Technology: Agile, CI, testing, development processes, tools</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">General / Specific Experience Level: Beginner / Beginner</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Co-Presented with Josh Carroll.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Want to increase visibility, collaboration, and communication in your development process? Striving to ensure higher quality products with rapid feedback cycles? Don&#8217;t know where to start?</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Our goal is to show you how we use simple tools and practices to work in an agile way &#8211; without any fluff. We will cover how we manage our task board and source code; simple continuous integration; unit testing with mocks; design patterns for clean separation of concerns and testability. All in one hour. &#8216;Cause that&#8217;s how we roll.</div>
<p style="padding-left: 30px;"><strong>Chaos to Awesome in 60 minutes / the heart of Agile without all the fluff</strong></p>
<p style="padding-left: 30px;">
<p style="padding-left: 30px;"><strong>Track / Area:</strong> Developer / Methodology</p>
<p style="padding-left: 30px;"><strong>Technology:</strong> Agile, CI, testing, development processes, tools</p>
<p style="padding-left: 30px;"><strong>General / Specific Experience Level:</strong> Beginner / Beginner</p>
<p style="padding-left: 30px;">
<p style="padding-left: 30px;">Co-Presented with<strong> Josh Carroll</strong>.</p>
<p style="padding-left: 30px;">
<p style="padding-left: 30px;">Want to increase visibility, collaboration, and communication in your development process? Striving to ensure higher quality products with rapid feedback cycles? Don&#8217;t know where to start?</p>
<p style="padding-left: 30px;">
<p style="padding-left: 30px;">Our goal is to show you how we use simple tools and practices to work in an agile way &#8211; without any fluff. We will cover how we manage our task board and source code; simple continuous integration; unit testing with mocks; design patterns for clean separation of concerns and testability. All in one hour. &#8216;Cause that&#8217;s how we roll.</p>
<p>You can check out all the details on the <a href="http://codestock.org/Sessions/chaos-to-awesome-in-60-minutes--the-heart-of-agile-without-all-the-fluff.aspx">CodeStock session page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.cyragon.com/2010/03/codestock-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
