<?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>SirMike&#039;s Techblog &#187; Programming</title>
	<atom:link href="http://sirmike.org/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://sirmike.org</link>
	<description>C++, C#, ASP.NET, OpenGL, DirectX, Game developing</description>
	<lastBuildDate>Sun, 03 Jan 2010 15:36:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Testing code snippets for Visual Studio</title>
		<link>http://sirmike.org/2009/10/30/testing-code-snippets-for-visual-studio/</link>
		<comments>http://sirmike.org/2009/10/30/testing-code-snippets-for-visual-studio/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 16:58:21 +0000</pubDate>
		<dc:creator>SirMike</dc:creator>
				<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://www.sirmike.org/?p=260</guid>
		<description><![CDATA[If you create many test classes and test methods you probably repeat some code many times.
Here are some code snippets that I use every day at work, feel free to modify them if you want.

Test class
PLAIN TEXT
XML:




&#60;?xml version="1.0"?&#62;


&#60;CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"&#62;


&#160; &#60;CodeSnippet Format="1.0.0"&#62;


&#160; &#160; &#60;Header&#62;


&#160; &#160; &#160; &#60;Title&#62;Create a test class&#60;/Title&#62;


&#160; &#160; &#160; &#60;Description&#62;This snippet adds code [...]]]></description>
			<content:encoded><![CDATA[<p>If you create many test classes and test methods you probably repeat some code many times.<br />
Here are some code snippets that I use every day at work, feel free to modify them if you want.</p>
<p><span id="more-260"></span></p>
<p><strong>Test class</strong></p>
<div class="igBar"><span id="lxml-5"><a href="#" onclick="javascript:showPlainTxt('xml-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-5">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span>?<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;CodeSnippets</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">"http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;CodeSnippet</span> <span style="color: #000066;">Format</span>=<span style="color: #ff0000;">"1.0.0"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Header<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Title<span style="font-weight: bold; color: black;">&gt;</span></span></span>Create a test class<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Title<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Description<span style="font-weight: bold; color: black;">&gt;</span></span></span>This snippet adds code to create test class template.<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Description<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Shortcut<span style="font-weight: bold; color: black;">&gt;</span></span></span>testclass<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Shortcut<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Header<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Snippet<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Declarations<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Object<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ID<span style="font-weight: bold; color: black;">&gt;</span></span></span>Name<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ID<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ToolTip<span style="font-weight: bold; color: black;">&gt;</span></span></span>Name of a test class<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ToolTip<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Default<span style="font-weight: bold; color: black;">&gt;</span></span></span>Name<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Default<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Object<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Declarations<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Code</span> <span style="color: #000066;">Language</span>=<span style="color: #ff0000;">"csharp"</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #339933;">&lt;![CDATA[[TestClass]</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; public class $Name$</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; {</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $end$</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; }]]&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Code<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Snippet<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/CodeSnippet<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/CodeSnippets<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Test method</strong></p>
<div class="igBar"><span id="lxml-6"><a href="#" onclick="javascript:showPlainTxt('xml-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-6">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span>?<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;CodeSnippets</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">"http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;CodeSnippet</span> <span style="color: #000066;">Format</span>=<span style="color: #ff0000;">"1.0.0"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Header<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Title<span style="font-weight: bold; color: black;">&gt;</span></span></span>Create a test method<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Title<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Description<span style="font-weight: bold; color: black;">&gt;</span></span></span>This snippet adds code to create test method template.<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Description<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Shortcut<span style="font-weight: bold; color: black;">&gt;</span></span></span>testmethod<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Shortcut<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Header<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Snippet<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Declarations<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Object<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ID<span style="font-weight: bold; color: black;">&gt;</span></span></span>Name<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ID<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ToolTip<span style="font-weight: bold; color: black;">&gt;</span></span></span>Name of a method which is being tested<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ToolTip<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Default<span style="font-weight: bold; color: black;">&gt;</span></span></span>Name<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Default<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Object<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Object<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ID<span style="font-weight: bold; color: black;">&gt;</span></span></span>State<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ID<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ToolTip<span style="font-weight: bold; color: black;">&gt;</span></span></span>State of input data<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ToolTip<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Default<span style="font-weight: bold; color: black;">&gt;</span></span></span>State<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Default<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Object<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Object<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ID<span style="font-weight: bold; color: black;">&gt;</span></span></span>Result<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ID<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ToolTip<span style="font-weight: bold; color: black;">&gt;</span></span></span>Result of an assertion<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ToolTip<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Default<span style="font-weight: bold; color: black;">&gt;</span></span></span>Result<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Default<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Object<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Declarations<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Code</span> <span style="color: #000066;">Language</span>=<span style="color: #ff0000;">"csharp"</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #339933;">&lt;![CDATA[[TestMethod]</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; public void $Name$_$State$_$Result$()</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; {</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $end$</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; }]]&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Code<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Snippet<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/CodeSnippet<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/CodeSnippets<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Rhino mocks record / playback routine</strong></p>
<div class="igBar"><span id="lxml-7"><a href="#" onclick="javascript:showPlainTxt('xml-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-7">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span>?<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;CodeSnippets</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">"http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;CodeSnippet</span> <span style="color: #000066;">Format</span>=<span style="color: #ff0000;">"1.0.0"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Header<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Title<span style="font-weight: bold; color: black;">&gt;</span></span></span>Create a record / playback routine for rhino mocks<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Title<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Description<span style="font-weight: bold; color: black;">&gt;</span></span></span>This snippet adds code to create record / playback routine for unit testing.<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Description<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Shortcut<span style="font-weight: bold; color: black;">&gt;</span></span></span>recordplayback<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Shortcut<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Header<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Snippet<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Declarations<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Object<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ID<span style="font-weight: bold; color: black;">&gt;</span></span></span>mocks<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ID<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ToolTip<span style="font-weight: bold; color: black;">&gt;</span></span></span>Mock repository object name<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ToolTip<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Default<span style="font-weight: bold; color: black;">&gt;</span></span></span>mocks<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Default<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Object<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Declarations<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Code</span> <span style="color: #000066;">Language</span>=<span style="color: #ff0000;">"csharp"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;![CDATA[using(mocks.Record())</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $end$</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; using(mocks.Playback())</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">]]&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Code<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Snippet<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/CodeSnippet<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/CodeSnippets<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Throw ArgumentNullException when a method's argument cannot be null</strong></p>
<div class="igBar"><span id="lxml-8"><a href="#" onclick="javascript:showPlainTxt('xml-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-8">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span>?<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;CodeSnippets</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">"http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;CodeSnippet</span> <span style="color: #000066;">Format</span>=<span style="color: #ff0000;">"1.0.0"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Header<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Title<span style="font-weight: bold; color: black;">&gt;</span></span></span>Create argument null checking routine<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Title<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Description<span style="font-weight: bold; color: black;">&gt;</span></span></span>This snippet adds code to create a code to check whether param was null ane throw an exception when applicable.<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Description<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Shortcut<span style="font-weight: bold; color: black;">&gt;</span></span></span>checkparam<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Shortcut<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Header<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Snippet<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Declarations<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Object<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ID<span style="font-weight: bold; color: black;">&gt;</span></span></span>parameter<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ID<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ToolTip<span style="font-weight: bold; color: black;">&gt;</span></span></span>parameter<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ToolTip<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Default<span style="font-weight: bold; color: black;">&gt;</span></span></span>parameter<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Default<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Object<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Declarations<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Code</span> <span style="color: #000066;">Language</span>=<span style="color: #ff0000;">"csharp"</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #339933;">&lt;![CDATA[if ($parameter$ == null)</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">{</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; throw new ArgumentNullException(&quot;$parameter$&quot;);</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">}</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; ]]&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Code<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Snippet<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/CodeSnippet<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/CodeSnippets<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://sirmike.org/2009/10/30/testing-code-snippets-for-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating enum which sucks</title>
		<link>http://sirmike.org/2009/04/22/creating-enum-which-sucks/</link>
		<comments>http://sirmike.org/2009/04/22/creating-enum-which-sucks/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 20:53:33 +0000</pubDate>
		<dc:creator>SirMike</dc:creator>
				<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sirmike.org/2009/04/22/creating-enum-which-sucks/</guid>
		<description><![CDATA[We create many enumerations in our programs. But sometimes we can make a mistake that drives somebody else mad.
Let's suppose that the first programmer created an enum like this:

PLAIN TEXT
C#:




enum Mood 


&#123; 


&#160; &#160; Unknown = -1, 


&#160; &#160; Awesome, 


&#160; &#160; Cool, 


&#160; &#160; Bad, 


&#160; &#160; Awful 


&#125; 






It does not look bad [...]]]></description>
			<content:encoded><![CDATA[<p>We create many enumerations in our programs. But sometimes we can make a mistake that drives somebody else mad.</p>
<p>Let's suppose that the first programmer created an enum like this:</p>
<p>
<div class="igBar"><span id="lcsharp-12"><a href="#" onclick="javascript:showPlainTxt('csharp-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C#:</span>
<div id="csharp-12">
<div class="csharp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #FF0000;">enum</span> Mood </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Unknown = -<span style="color: #FF0000;color:#800000;">1</span>, </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Awesome, </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Cool, </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Bad, </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; Awful </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>It does not look bad at the first look, yet another enum.</p>
<p>Another programmer created a list:</p>
<p>
<div class="igBar"><span id="lcsharp-13"><a href="#" onclick="javascript:showPlainTxt('csharp-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C#:</span>
<div id="csharp-13">
<div class="csharp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">List&lt;mood&gt; availableMoods = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> List&lt;mood&gt;<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">availableMoods.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>Mood.<span style="color: #0000FF;">Awful</span><span style="color: #000000;">&#41;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">availableMoods.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>Mood.<span style="color: #0000FF;">Bad</span><span style="color: #000000;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p> </p>
<p>Then he would like to find there a first mood type which is a part of &quot;good mood&quot; group and pass the result to another layer of an application. He wrote the code:</p>
<p>
<div class="igBar"><span id="lcsharp-14"><a href="#" onclick="javascript:showPlainTxt('csharp-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C#:</span>
<div id="csharp-14">
<div class="csharp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Mood found = availableMoods.<span style="color: #0000FF;">Find</span><span style="color: #000000;">&#40;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #FF0000;">delegate</span><span style="color: #000000;">&#40;</span>Mood f<span style="color: #000000;">&#41;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;">&#123;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">return</span> f == Mood.<span style="color: #0000FF;">Awesome</span> || f == Mood.<span style="color: #0000FF;">Cool</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now he realized that it cannot work because Find method of a List(T) class returns default(T) when a list does not contain desired item. In this case he would get Mood.Awesome because it is the default value of the enum. I do not need to add that the Mood.Awesome is not even the part of the list.</p>
<p>We can solve this problem by several different approaches.</p>
<ol>
<li>Create different enum where the default element will be &quot;Unknown = 0&quot; </li>
<li>Use FindIndex method of List(T) class so we will be able to handle the situation of not found element </li>
<li>I believe that other approaches could work as well </li>
</ol>
<p>The question to discuss - which programmer made a mistake? The first one who created &quot;unfortunate&quot; enum or the second one who used wrong structure / wrong searching method?</p>
]]></content:encoded>
			<wfw:commentRss>http://sirmike.org/2009/04/22/creating-enum-which-sucks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TDD for dummies</title>
		<link>http://sirmike.org/2008/11/24/tdd-for-dummies/</link>
		<comments>http://sirmike.org/2008/11/24/tdd-for-dummies/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 22:51:43 +0000</pubDate>
		<dc:creator>SirMike</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sirmike.org/?p=206</guid>
		<description><![CDATA[I am writing this post on behalf my friend   He does not write anything by himself but many of his thoughts are very accurate and meaningful - I decided to share it with you.
So if you are intrested on Test Driven Development, go on...

Many people who are just starting with TDD (like me [...]]]></description>
			<content:encoded><![CDATA[<p>I am writing this post on behalf my friend <img src='http://sirmike.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  He does not write anything by himself but many of his thoughts are very accurate and meaningful - I decided to share it with you.</p>
<p>So if you are intrested on Test Driven Development, go on...<br />
<span id="more-206"></span></p>
<p>Many people who are just starting with TDD (like me <img src='http://sirmike.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ) see it as useless, faddy term. Many of them do not see a benefit of unit testing and cannot imagine wasting time for writing tests. Many of them write unit tests after finishing main implementation, which in my opinion, is even worse.</p>
<p>I would like to describe a Test Driven Development as simply as possible <img src='http://sirmike.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Imagine that you want to build a house from scratch. But we must do one important assumption - we can rebuild it any time we want, just like it was built from Lego blocks <img src='http://sirmike.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>In a traditional approach we would:</strong></p>
<ul>
<li>Prepare documents, make a project, plan every room, door, windows etc. Garage is also in the plans, yes we must have a garage <img src='http://sirmike.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>OK, walls are standing, floors are ready. </li>
<li>We apparently realized that a bed is little bit too long but it was so cool that we could not miss the chance to buy it <img src='http://sirmike.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  We must live with that, or rebuild the room completely.</li>
<li>It would be good to have some water - of course, we have got many pipes, it should work</li>
<li>Ooops, It would be better to have a sink on the other side of a kitchen, your wife decided that it would be nicer to have it by a window. Well, we can do that...</li>
<li>Redesigning and rebuilding pipes in a kitchen takes a few weeks, your wife seems to be happy</li>
<li>You're exhausted but happy that wife will have easier life in the kitchen</li>
<li>Suddenly your wife says: "You know... that previous design was better, now I must walk twice to take all pots and pans"</li>
<li>Ooops, you set your teeth and start rebuilding a kitchen once more</li>
<li>you almost finished... but wait, the garage <img src='http://sirmike.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  Yes, we must have the garage.</li>
<li>after 2 weeks there is a garage with shiny roof <img src='http://sirmike.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Brilliant, but we do not have a car :/ Ehh, it does not matter, we will buy it for sure next year.</li>
<li>... after several months of building (and rebuilding) you finally got a house and it seems to be very nice from the outside. You have plenty features like fancy slates or a garage (but you do not have a car <img src='http://sirmike.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> )</li>
</ul>
<p>As we can see you spent 70% of your time on rebuilding and making workarounds, you're still not sure whether your pipe redesigning broke something else in the bathroom. You can only test it by turning on the faucet and praying that it will not blow <img src='http://sirmike.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  After a year of living you decide to buy a car - great big van on a promotion. But wait, your garage is too small, it was designed for housing tiny little sport car <img src='http://sirmike.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p><strong>Let's see how it would like with TDD approach:</strong></p>
<ul>
<li>You do not prepare unnecesary documents and do not plan every detail. Just enough to start.</li>
<li>You want to sleep somwhere, huh? OK, let's put a bed in the center of the field</li>
<li>It would be nice to have walls and a ceiling. But wait, we should try it and then build.</li>
<li>Then, mock walls and ceiling because we do not need them to test if a bed is comfortable <img src='http://sirmike.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Give them order to return 2 windows and door.</li>
<li>Is it comfortable to sleep there? No? OK, add another window to the mock</li>
<li>Perfect, build the room and move on to the kitchen...</li>
<li>... wait, there's no kitchen yet. No problem, build it next to a bedroom. Actually, you can build it wherever you want. You can always move it later.</li>
<li>mock a kitchen with pipes, so your wife could test whether a sink will fit her needs. You can also make a stub of ICorridor with WalkMe() method.</li>
<li>do some tests and check whether it will work or not. </li>
<li>Check the case when WalkMe() returns 15 steps, is it enough? No? OK, do a test when a corridor.WalkMe() returns only 3 steps.</li>
<li>if it still does not work, prepare some other test cases and refactor your kitchen just enough to fulfill every indulge of your wife <img src='http://sirmike.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>when everything seems to be fitting, your wife is happy and a corridor is long enough, leave the kitchen</li>
<li>as you can see, every change is quick and eventual alterations are not time-consuming</li>
<li>after several months of building (and rebuilding) you finally got a house. You spent one month longer on testing, your house seems to be very nice from the outside... and you're sure that all of your needs are fulfilled. No bloats, no unnecessary features.</li>
</ul>
<p>The result is pretty much the same as if you were built it with traditional approach. However there are several tiny differences that diametrically change your house as a whole:</p>
<ol>
<li>No unnecessary features. You avoided unnecessary garage, but you were able to test several pipe designs instead.</li>
<li>You ARE SURE that every need is fulfilled and every feature in your house just work.</li>
<li>Finally, you are PRETTY SURE that any modifications in the future can be applied without fear.</li>
</ol>
<p>I do not have much experience in XP programming, TDD and any other light approaches. However, I have much experience with legacy and bloated code. I have also much experience with undetermined clients. It was very easy to see the difference between traditional approach and test driven development. If you have some time to try TDD, I encounter you to do it <img src='http://sirmike.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://sirmike.org/2008/11/24/tdd-for-dummies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# &#8211; ref modifier</title>
		<link>http://sirmike.org/2008/10/06/c-ref-modifier/</link>
		<comments>http://sirmike.org/2008/10/06/c-ref-modifier/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 19:55:58 +0000</pubDate>
		<dc:creator>SirMike</dc:creator>
				<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://www.sirmike.org/?p=196</guid>
		<description><![CDATA[I am writing this post for myself because I am often confused when analysing a code with ref's used on objects  
If you're not interested in - don't read.

PLAIN TEXT
C#:




using System;


&#160;


namespace Ref


&#123;


&#160; &#160; class Foo


&#160; &#160; &#123;


&#160; &#160; &#160; &#160; private int bar = 0;


&#160;


&#160; &#160; &#160; &#160; public int Bar


&#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>I am writing this post for myself because I am often confused when analysing a code with ref's used on objects <img src='http://sirmike.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you're not interested in - don't read.</p>
<p><span id="more-196"></span></p>
<div class="igBar"><span id="lcsharp-16"><a href="#" onclick="javascript:showPlainTxt('csharp-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C#:</span>
<div id="csharp-16">
<div class="csharp">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0600FF;">namespace</span> <span style="color: #0600FF;">Ref</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #FF0000;">class</span> Foo</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">private</span> <span style="color: #FF0000;">int</span> bar = <span style="color: #FF0000;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">int</span> Bar</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">return</span> bar;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bar = value;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">public</span> Foo<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> bar<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">bar</span> = bar;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #FF0000;">class</span> Program</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> Test<span style="color: #000000;">&#40;</span>Foo f<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; f.<span style="color: #0000FF;">Bar</span> = <span style="color: #FF0000;color:#800000;">50</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; f = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Foo<span style="color: #000000;">&#40;</span><span style="color: #FF0000;color:#800000;">30</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> Test<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ref</span> Foo f<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; f.<span style="color: #0000FF;">Bar</span> = <span style="color: #FF0000;color:#800000;">50</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; f = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Foo<span style="color: #000000;">&#40;</span><span style="color: #FF0000;color:#800000;">30</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> Main<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> args<span style="color: #000000;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Foo foo1 = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Foo<span style="color: #000000;">&#40;</span><span style="color: #FF0000;color:#800000;">0</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Foo foo2 = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Foo<span style="color: #000000;">&#40;</span><span style="color: #FF0000;color:#800000;">0</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Test<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ref</span> foo1<span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Test<span style="color: #000000;">&#40;</span>foo2<span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>foo1.<span style="color: #0000FF;">Bar</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>foo2.<span style="color: #0000FF;">Bar</span><span style="color: #000000;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>program output:</p>
<p><code><br />
30<br />
50<br />
</code></p>
<p>Now, I should remember it.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirmike.org/2008/10/06/c-ref-modifier/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My 3D Effects</title>
		<link>http://sirmike.org/2008/09/20/my-3d-effects/</link>
		<comments>http://sirmike.org/2008/09/20/my-3d-effects/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 22:46:50 +0000</pubDate>
		<dc:creator>SirMike</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[DirectX]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sirmike.org/2008/09/20/my-3d-effects/</guid>
		<description><![CDATA[I added a new section to this blog called "3D Effects" - you can download there some DX / OGL effects which I coded in my free time.
Go to 3D Effects page
]]></description>
			<content:encoded><![CDATA[<p>I added a new section to this blog called "3D Effects" - you can download there some DX / OGL effects which I coded in my free time.</p>
<p><a href="3d-effects">Go to 3D Effects page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sirmike.org/2008/09/20/my-3d-effects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging in VC# Express 2008</title>
		<link>http://sirmike.org/2008/09/17/debugging-in-vc-express-2008/</link>
		<comments>http://sirmike.org/2008/09/17/debugging-in-vc-express-2008/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 16:46:30 +0000</pubDate>
		<dc:creator>SirMike</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sirmike.org/2008/09/17/debugging-in-vc-express-2008/</guid>
		<description><![CDATA[Would you like to debug a windows service in Visual C# 2008 Express?
No fucking way - Microsoft removed all remote debugging features from Express edition. Shit :/
]]></description>
			<content:encoded><![CDATA[<p>Would you like to debug a windows service in Visual C# 2008 Express?<br />
No fucking way - Microsoft removed all remote debugging features from Express edition. Shit :/</p>
]]></content:encoded>
			<wfw:commentRss>http://sirmike.org/2008/09/17/debugging-in-vc-express-2008/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>.NET Reflector acquired by Red Gate</title>
		<link>http://sirmike.org/2008/08/27/net-reflector-acquired-by-red-gate/</link>
		<comments>http://sirmike.org/2008/08/27/net-reflector-acquired-by-red-gate/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 16:46:35 +0000</pubDate>
		<dc:creator>SirMike</dc:creator>
				<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sirmike.org/2008/08/27/net-reflector-acquired-by-red-gate/</guid>
		<description><![CDATA[According to Lutz Roeder information sent to subscribers, .NET Reflector was acquired by Red Gate. Although they claimed that this application remained free, I am 99% sure that in a few months, non-free (or extended) version will be released   We will see.
]]></description>
			<content:encoded><![CDATA[<p>According to Lutz Roeder information sent to subscribers, <a href="http://www.red-gate.com/products/reflector/">.NET Reflector</a> was acquired by Red Gate. Although they claimed that this application remained free, I am 99% sure that in a few months, non-free (or extended) version will be released <img src='http://sirmike.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  We will see.</p>
]]></content:encoded>
			<wfw:commentRss>http://sirmike.org/2008/08/27/net-reflector-acquired-by-red-gate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing tetris &#8211; part 5</title>
		<link>http://sirmike.org/2008/05/19/writing-tetris-part-5/</link>
		<comments>http://sirmike.org/2008/05/19/writing-tetris-part-5/#comments</comments>
		<pubDate>Mon, 19 May 2008 00:59:57 +0000</pubDate>
		<dc:creator>SirMike</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sirmike.org/2008/05/19/writing-tetris-part-5/</guid>
		<description><![CDATA[A game without sounds and some dynamic action is bad... So I had to do it 
This is just a small presentation without all features included but looks quite nice.

How do you like it?
]]></description>
			<content:encoded><![CDATA[<p>A game without sounds and some dynamic action is bad... So I had to do it <img src='http://sirmike.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
This is just a small presentation without all features included but looks quite nice.</p>
<p><object type="application/x-shockwave-flash" style="width:425px; height:355px;" data="http://www.youtube.com/v/56_8VtxcZWA&#038;hl=en"><param name="movie" value="http://www.youtube.com/v/56_8VtxcZWA&#038;hl=en" /></object></p>
<p>How do you like it?</p>
]]></content:encoded>
			<wfw:commentRss>http://sirmike.org/2008/05/19/writing-tetris-part-5/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Writing tetris &#8211; part 4</title>
		<link>http://sirmike.org/2008/05/19/writing-tetris-part-4/</link>
		<comments>http://sirmike.org/2008/05/19/writing-tetris-part-4/#comments</comments>
		<pubDate>Mon, 19 May 2008 00:51:16 +0000</pubDate>
		<dc:creator>SirMike</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sirmike.org/2008/05/19/writing-tetris-part-4/</guid>
		<description><![CDATA[Every 3D game has cool graphics effects. It would be nice to have one when "collecting a line". Let's create some particles...

Oh fuck... it looks like somebody slaught a pig 
After several minutes of tuning it looks much better...

Hmmm... I'm proud of myself  
]]></description>
			<content:encoded><![CDATA[<p>Every 3D game has cool graphics effects. It would be nice to have one when "collecting a line". Let's create some particles...</p>
<p><a href='http://www.sirmike.org/wp-content/uploads/2008/05/4.png' title='tetris - particles crap'><img src='http://www.sirmike.org/wp-content/uploads/2008/05/4.thumbnail.png' alt='tetris - particles crap' /></a></p>
<p>Oh fuck... it looks like somebody slaught a pig <img src='http://sirmike.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
After several minutes of tuning it looks much better...</p>
<p><a href='http://www.sirmike.org/wp-content/uploads/2008/05/5.png' title='tetris - particles nice'><img src='http://www.sirmike.org/wp-content/uploads/2008/05/5.thumbnail.png' alt='tetris - particles nice' /></a></p>
<p>Hmmm... I'm proud of myself <img src='http://sirmike.org/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://sirmike.org/2008/05/19/writing-tetris-part-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing tetris &#8211; part 3</title>
		<link>http://sirmike.org/2008/05/19/writing-tetris-part-3/</link>
		<comments>http://sirmike.org/2008/05/19/writing-tetris-part-3/#comments</comments>
		<pubDate>Mon, 19 May 2008 00:44:56 +0000</pubDate>
		<dc:creator>SirMike</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.sirmike.org/2008/05/19/writing-tetris-part-3/</guid>
		<description><![CDATA[Most of a game mechanics are ready. It's time for tuning visual part.
The playfield has been added and blocks have better texture now.
It is looking better and better  

]]></description>
			<content:encoded><![CDATA[<p>Most of a game mechanics are ready. It's time for tuning visual part.<br />
The playfield has been added and blocks have better texture now.<br />
It is looking better and better <img src='http://sirmike.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href='http://www.sirmike.org/wp-content/uploads/2008/05/3.png' title='tetris - nice'><img src='http://www.sirmike.org/wp-content/uploads/2008/05/3.thumbnail.png' alt='tetris - nice' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://sirmike.org/2008/05/19/writing-tetris-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
