<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Byteflux</title>
	
	<link>http://byteflux.me</link>
	<description>Sebastian Negomireanu's Weblog</description>
	<lastBuildDate>Mon, 09 Apr 2012 07:31:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<meta xmlns="http://www.w3.org/1999/xhtml" name="robots" content="noindex,follow" />
<cloud domain="byteflux.me" port="80" path="/?rsscloud=notify" registerProcedure="" protocol="http-post" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/byteflux/kync" /><feedburner:info uri="byteflux/kync" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Converting a class library to WPF control library</title>
		<link>http://feedproxy.google.com/~r/byteflux/kync/~3/24E71TGaN4s/</link>
		<comments>http://byteflux.me/index.php/2012/04/09/converting-a-class-library-to-wpf-control-library/#comments</comments>
		<pubDate>Mon, 09 Apr 2012 07:28:59 +0000</pubDate>
		<dc:creator>Sebastian Negomireanu</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Control Library]]></category>
		<category><![CDATA[refactoring]]></category>

		<guid isPermaLink="false">http://byteflux.me/?p=197</guid>
		<description><![CDATA[<table cellpadding='10'><tr><td valign='top' align='left'><p>Categories: <a href="http://byteflux.me/index.php/category/code/dotnet/" title="View all posts in .NET" rel="category tag">.NET</a>, <a href="http://byteflux.me/index.php/category/code/csharp/" title="View all posts in C#" rel="category tag">C#</a>, <a href="http://byteflux.me/index.php/category/code/" title="View all posts in Code" rel="category tag">Code</a>, <a href="http://byteflux.me/index.php/category/code/wpf/" title="View all posts in WPF" rel="category tag">WPF</a></p><p>Tags: <a href="http://byteflux.me/index.php/tag/dotnet/" rel="tag">.NET</a>, <a href="http://byteflux.me/index.php/tag/control-library/" rel="tag">Control Library</a>, <a href="http://byteflux.me/index.php/tag/refactoring/" rel="tag">refactoring</a>, <a href="http://byteflux.me/index.php/tag/wpf/" rel="tag">WPF</a></p>In Visual Studio 2010, depending on the project type you get different options when you want to add new items to a project. If you have created a class library and later you figure out that you want to add WPF custom controls, you will need to change the project so that it supports this [...]<table width='100%'><tr><td align=right><p><b>(<a href='http://byteflux.me/index.php/2012/04/09/converting-a-class-library-to-wpf-control-library/' title='Converting a class library to WPF control library'>Read more...</a>)</b></p></td></tr></table></td></tr></table>]]></description>
			<content:encoded><![CDATA[<p>In Visual Studio 2010, depending on the project type you get different options when you want to add new items to a project. If you have created a class library and later you figure out that you want to add WPF custom controls, you will need to change the project so that it supports this functionality.</p>
<p><span id="more-197"></span>
<p>Changing the project type is an easy task. You need to open up the .csproj file in a text editor and add the following tag under the &lt;PropertyGroup&gt; element:</p>
<p><strong>&lt;ProjectTypeGuids&gt;{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&lt;/ProjectTypeGuids&gt;</strong></p>
<p>You will also need to add the following WPF references with Visual Studio:</p>
<ul>
<li>PresentationCore </li>
<li>PresentationFramework </li>
<li>System.Xaml </li>
<li>WindowsBase </li>
</ul>
<p>Once everything is done, you can add a new CustomControl to the project:</p>
<p><a href="http://byteflux.me/wp-content/uploads/2012/04/image.png" rel="lytebox"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2012/04/image_thumb.png" width="244" height="170" /></a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/3cjwv6A2rcXfobA7BrP2XKLa3C4/0/da"><img src="http://feedads.g.doubleclick.net/~a/3cjwv6A2rcXfobA7BrP2XKLa3C4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/3cjwv6A2rcXfobA7BrP2XKLa3C4/1/da"><img src="http://feedads.g.doubleclick.net/~a/3cjwv6A2rcXfobA7BrP2XKLa3C4/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/byteflux/kync/~4/24E71TGaN4s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://byteflux.me/index.php/2012/04/09/converting-a-class-library-to-wpf-control-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://byteflux.me/index.php/2012/04/09/converting-a-class-library-to-wpf-control-library/</feedburner:origLink></item>
		<item>
		<title>Validating UnityContainer configuration</title>
		<link>http://feedproxy.google.com/~r/byteflux/kync/~3/_K-MNB8IeSY/</link>
		<comments>http://byteflux.me/index.php/2011/10/05/validating-unitycontainer-configuration/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 05:38:00 +0000</pubDate>
		<dc:creator>Sebastian Negomireanu</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[dependency injection]]></category>
		<category><![CDATA[DI]]></category>
		<category><![CDATA[inversion of control]]></category>
		<category><![CDATA[IOC]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[unity]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://byteflux.me/?p=189</guid>
		<description><![CDATA[<table cellpadding='10'><tr><td valign='top' align='left'><p>Categories: <a href="http://byteflux.me/index.php/category/code/dotnet/" title="View all posts in .NET" rel="category tag">.NET</a>, <a href="http://byteflux.me/index.php/category/code/csharp/" title="View all posts in C#" rel="category tag">C#</a>, <a href="http://byteflux.me/index.php/category/code/" title="View all posts in Code" rel="category tag">Code</a>, <a href="http://byteflux.me/index.php/category/tdd/" title="View all posts in TDD" rel="category tag">TDD</a></p><p>Tags: <a href="http://byteflux.me/index.php/tag/csharp/" rel="tag">C#</a>, <a href="http://byteflux.me/index.php/tag/dependency-injection/" rel="tag">dependency injection</a>, <a href="http://byteflux.me/index.php/tag/di/" rel="tag">DI</a>, <a href="http://byteflux.me/index.php/tag/inversion-of-control/" rel="tag">inversion of control</a>, <a href="http://byteflux.me/index.php/tag/ioc/" rel="tag">IOC</a>, <a href="http://byteflux.me/index.php/tag/tdd/" rel="tag">TDD</a>, <a href="http://byteflux.me/index.php/tag/test/" rel="tag">test</a>, <a href="http://byteflux.me/index.php/tag/unity/" rel="tag">unity</a>, <a href="http://byteflux.me/index.php/tag/validation/" rel="tag">validation</a></p>In one of my recent projects I have reached the need to validate that I have all dependencies correctly registered in my UnityContainer. For those that are not familiar with Unity, it is a dependency injection container that allows constructor, property and method call dependency injection. You can get more information about how Unity works [...]<table width='100%'><tr><td align=right><p><b>(<a href='http://byteflux.me/index.php/2011/10/05/validating-unitycontainer-configuration/' title='Validating UnityContainer configuration'>Read more...</a>)</b></p></td></tr></table></td></tr></table>]]></description>
			<content:encoded><![CDATA[<p>In one of my recent projects I have reached the need to validate that I have all dependencies correctly registered in my UnityContainer. For those that are not familiar with Unity, it is a dependency injection container that allows constructor, property and method call dependency injection. </p>
<p>You can get more information about how Unity works and also download the latest release from Codeplex: <a href="http://unity.codeplex.com/">http://unity.codeplex.com/</a></p>
<p><a href="http://dotnetshoutout.com/Validating-UnityContainer-configuration" rev="vote-for"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fbyteflux.me%2F%3Fp%3D189" /></a> </p>
<p>&#160;</p>
<p><span id="more-189"></span>
<p>The problem with Unity is that you have to have all dependencies registered in the container, otherwise when you will try to resolve a type that depends on other non-registered types you will get an exception. Other containers like StructureMap (<a href="http://structuremap.net/structuremap/index.html">http://structuremap.net/structuremap/index.html</a>) have a method of validating the entire configuration so that you can use it in an automated test. </p>
<p>Since Unity lacks this functionality, I have decided to create an extension method that will validate all mappings. Basically this method goes through all registered types and tries to resolve them. If a type is not properly registered, it will fail and the exception you get from Unity lets you know which mapping is invalid.</p>
<p>You can get the code for the extension here: <a href="http://codepaste.net/hqf45s">http://codepaste.net/hqf45s</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/_b0wQAQqVQSkE1A4BK4_MbAjd4I/0/da"><img src="http://feedads.g.doubleclick.net/~a/_b0wQAQqVQSkE1A4BK4_MbAjd4I/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/_b0wQAQqVQSkE1A4BK4_MbAjd4I/1/da"><img src="http://feedads.g.doubleclick.net/~a/_b0wQAQqVQSkE1A4BK4_MbAjd4I/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/byteflux/kync/~4/_K-MNB8IeSY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://byteflux.me/index.php/2011/10/05/validating-unitycontainer-configuration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://byteflux.me/index.php/2011/10/05/validating-unitycontainer-configuration/</feedburner:origLink></item>
		<item>
		<title>Reusable deferred action execution mechanism</title>
		<link>http://feedproxy.google.com/~r/byteflux/kync/~3/ye0EpVX5DzA/</link>
		<comments>http://byteflux.me/index.php/2011/08/24/reusable-deferred-action-execution-mechanism/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 12:05:49 +0000</pubDate>
		<dc:creator>Sebastian Negomireanu</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://byteflux.me/index.php/2011/08/24/reusable-deferred-action-execution-mechanism/</guid>
		<description><![CDATA[<table cellpadding='10'><tr><td valign='top' align='left'><p>Categories: <a href="http://byteflux.me/index.php/category/code/dotnet/" title="View all posts in .NET" rel="category tag">.NET</a>, <a href="http://byteflux.me/index.php/category/code/csharp/" title="View all posts in C#" rel="category tag">C#</a>, <a href="http://byteflux.me/index.php/category/code/" title="View all posts in Code" rel="category tag">Code</a></p><p>Tags: <a href="http://byteflux.me/index.php/tag/dotnet/" rel="tag">.NET</a>, <a href="http://byteflux.me/index.php/tag/code/" rel="tag">Code</a>, <a href="http://byteflux.me/index.php/tag/visual-studio/" rel="tag">visual studio</a></p>There are situations in which you need to do some processing when an event fires but you don’t want to do it every time if the event happens in a very short time interval. Such a situation can occur for example when handling MouseMove events – you want to do the processing when the mouse [...]<table width='100%'><tr><td align=right><p><b>(<a href='http://byteflux.me/index.php/2011/08/24/reusable-deferred-action-execution-mechanism/' title='Reusable deferred action execution mechanism'>Read more...</a>)</b></p></td></tr></table></td></tr></table>]]></description>
			<content:encoded><![CDATA[<p>There are situations in which you need to do some processing when an event fires but you don’t want to do it every time if the event happens in a very short time interval. Such a situation can occur for example when handling MouseMove events – you want to do the processing when the mouse stops for a certain amount of time, but not for every intermediate position of the mouse.</p>
<p><a href="http://dotnetshoutout.com/Reusable-deferred-action-execution-mechanism" rev="vote-for"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fbyteflux.me%2F%3Fp%3D180" /></a></p>
<p><span id="more-180"></span>I have created a reusable class that accomplishes this task. The class uses a timer internally and defers the execution until the timer interval elapses. If the event fires during the timer interval, the timer interval is reset. The current implementation uses a DispatcherTimer to execute the event (because I use it in UI-related code), but can be easily changed to use another timer if you need it.
<p>Using the LazyAction class is straightforward. You need to declare a field of type LazyAction:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1"> 1:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">readonly</span> LazyAction lazyAction;</pre>
</p></div>
</div>
<p>Somewhere (probably in the constructor) you need to initialize it:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1"> 1:</span> <span style="color: #0000ff">public</span> MyClass()</pre>
<p>
      <br />&#160; </p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2"> 2:</span> {                 <span style="color: #0000ff">this</span>.lazyAction = <span style="color: #0000ff">new</span> LazyAction(TimeSpan.FromMilliseconds(10), DoSomething);</pre>
<p>
      <br />&#160; </p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3"> 3:</span> }</pre>
</p></div>
</div>
<p>The constructor of the lazy action has two parameters:</p>
<ul>
<li><strong>deferredUpdateDelay</strong> – the time interval from the last call to Execute after which the action really gets executed </li>
<li><strong>action</strong> – the action to execute </li>
</ul>
<p>Suppose you handle the MouseMove event inside your class, you would execute the lazy action like this:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1"> 1:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> canvas_MouseMove(<span style="color: #0000ff">object</span> sender, MouseEventArgs e)</pre>
<p>
      <br />&#160; </p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2"> 2:</span> {     <span style="color: #0000ff">this</span>.lazyAction.Execute();</pre>
<p>
      <br />&#160; </p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3"> 3:</span> }</pre>
</p></div>
</div>
<p>There is just one caveat in using this approach – unit testing (at least using MSUnit) does not work as expected. The reason is that by using the DispatcherTimer inside our class, the timer won’t fire when running unit tests. This is caused by the fact that during running the unit tests the Dispatcher doesn’t automatically process its queue. A workaround for this is using the DispatcherUtil class found in this StackOverflow discussion: <a href="http://stackoverflow.com/questions/1106881/using-the-wpf-dispatcher-in-unit-tests">http://stackoverflow.com/questions/1106881/using-the-wpf-dispatcher-in-unit-tests</a>&#160;</p>
<p>Get the code here: <a title="http://byteflux.me/wp-content/uploads/2011/08/LazyAction.zip" href="http://byteflux.me/wp-content/uploads/2011/08/LazyAction.zip">LazyAction.zip</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/Z_n-70N49BDLvR-Ixhd9kfULku0/0/da"><img src="http://feedads.g.doubleclick.net/~a/Z_n-70N49BDLvR-Ixhd9kfULku0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Z_n-70N49BDLvR-Ixhd9kfULku0/1/da"><img src="http://feedads.g.doubleclick.net/~a/Z_n-70N49BDLvR-Ixhd9kfULku0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/byteflux/kync/~4/ye0EpVX5DzA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://byteflux.me/index.php/2011/08/24/reusable-deferred-action-execution-mechanism/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://byteflux.me/index.php/2011/08/24/reusable-deferred-action-execution-mechanism/</feedburner:origLink></item>
		<item>
		<title>A must have for any WPF developer</title>
		<link>http://feedproxy.google.com/~r/byteflux/kync/~3/6GY8y-L6_oU/</link>
		<comments>http://byteflux.me/index.php/2011/08/02/a-must-have-for-any-wpf-developer/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 07:29:41 +0000</pubDate>
		<dc:creator>Sebastian Negomireanu</dc:creator>
				<category><![CDATA[Add-ins]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[addins]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[utility]]></category>

		<guid isPermaLink="false">http://byteflux.me/index.php/2011/08/02/a-must-have-for-any-wpf-developer/</guid>
		<description><![CDATA[<table cellpadding='10'><tr><td valign='top' align='left'><p>Categories: <a href="http://byteflux.me/index.php/category/add-ins/" title="View all posts in Add-ins" rel="category tag">Add-ins</a>, <a href="http://byteflux.me/index.php/category/code/csharp/" title="View all posts in C#" rel="category tag">C#</a>, <a href="http://byteflux.me/index.php/category/tools/" title="View all posts in Tools" rel="category tag">Tools</a>, <a href="http://byteflux.me/index.php/category/code/wpf/" title="View all posts in WPF" rel="category tag">WPF</a></p><p>Tags: <a href="http://byteflux.me/index.php/tag/addins/" rel="tag">addins</a>, <a href="http://byteflux.me/index.php/tag/debugging/" rel="tag">debugging</a>, <a href="http://byteflux.me/index.php/tag/tools/" rel="tag">Tools</a>, <a href="http://byteflux.me/index.php/tag/utility/" rel="tag">utility</a>, <a href="http://byteflux.me/index.php/tag/wpf/" rel="tag">WPF</a></p>As a WPF developer, I often find myself trying to debug the visual structure of my applications or to find out why something doesn’t work as expected. The Visual Studio debugger can help up to a certain point, but for runtime visual debugging it lacks the necessary features. Luckily, there is an awesome free tool [...]<table width='100%'><tr><td align=right><p><b>(<a href='http://byteflux.me/index.php/2011/08/02/a-must-have-for-any-wpf-developer/' title='A must have for any WPF developer'>Read more...</a>)</b></p></td></tr></table></td></tr></table>]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 1px 13px 0px 0px; display: inline; float: left" align="left" src="http://www.cplotts.com/wp-content/uploads/2011/03/Snoop.png" width="59" height="59" /> As a WPF developer, I often find myself trying to debug the visual structure of my applications or to find out why something doesn’t work as expected. The Visual Studio debugger can help up to a certain point, but for runtime visual debugging it lacks the necessary features. Luckily, there is an awesome free tool that you can use for this – Snoop. The tool itself is very straightforward – you select your running application press a button and you can see the whole visual tree:</p>
<p>  <span id="more-177"></span>
<p><a href="http://byteflux.me/wp-content/uploads/2011/08/image.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/08/image_thumb.png" width="885" height="650" /></a></p>
<p>The great thing is that you can look at bindings, change properties at runtime and instantly see the changes, monitor events and also put breakpoints on property changes.</p>
<p>You can find download this from CodePlex: <a href="http://snoopwpf.codeplex.com/">http://snoopwpf.codeplex.com/</a>&#160;</p>
<p>Also, you can follow Cory Plott’s blog here for more updates, tips and tricks: <a href="http://www.cplotts.com/">http://www.cplotts.com/</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/I9o9MFPBTr-LKiU6iC3_qUvk0VE/0/da"><img src="http://feedads.g.doubleclick.net/~a/I9o9MFPBTr-LKiU6iC3_qUvk0VE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/I9o9MFPBTr-LKiU6iC3_qUvk0VE/1/da"><img src="http://feedads.g.doubleclick.net/~a/I9o9MFPBTr-LKiU6iC3_qUvk0VE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/byteflux/kync/~4/6GY8y-L6_oU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://byteflux.me/index.php/2011/08/02/a-must-have-for-any-wpf-developer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://byteflux.me/index.php/2011/08/02/a-must-have-for-any-wpf-developer/</feedburner:origLink></item>
		<item>
		<title>My list of Visual Studio 2010 Extensions</title>
		<link>http://feedproxy.google.com/~r/byteflux/kync/~3/jez7timKx38/</link>
		<comments>http://byteflux.me/index.php/2011/07/28/my-list-of-visual-studio-2010-extensions/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 11:29:52 +0000</pubDate>
		<dc:creator>Sebastian Negomireanu</dc:creator>
				<category><![CDATA[Add-ins]]></category>
		<category><![CDATA[Code generators]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[addins]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[refactoring]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[visualstudio]]></category>

		<guid isPermaLink="false">http://byteflux.me/index.php/2011/07/28/my-list-of-visual-studio-2010-extensions/</guid>
		<description><![CDATA[<table cellpadding='10'><tr><td valign='top' align='left'><p>Categories: <a href="http://byteflux.me/index.php/category/add-ins/" title="View all posts in Add-ins" rel="category tag">Add-ins</a>, <a href="http://byteflux.me/index.php/category/tools/code-generators/" title="View all posts in Code generators" rel="category tag">Code generators</a>, <a href="http://byteflux.me/index.php/category/tools/" title="View all posts in Tools" rel="category tag">Tools</a>, <a href="http://byteflux.me/index.php/category/tools/visual-studio-tools/" title="View all posts in Visual Studio" rel="category tag">Visual Studio</a></p><p>Tags: <a href="http://byteflux.me/index.php/tag/addins/" rel="tag">addins</a>, <a href="http://byteflux.me/index.php/tag/extensions/" rel="tag">extensions</a>, <a href="http://byteflux.me/index.php/tag/productivity/" rel="tag">productivity</a>, <a href="http://byteflux.me/index.php/tag/refactoring/" rel="tag">refactoring</a>, <a href="http://byteflux.me/index.php/tag/testing/" rel="tag">testing</a>, <a href="http://byteflux.me/index.php/tag/tools/" rel="tag">Tools</a>, <a href="http://byteflux.me/index.php/tag/visual-studio/" rel="tag">visual studio</a>, <a href="http://byteflux.me/index.php/tag/visualstudio/" rel="tag">visualstudio</a></p>I find that with the extension support in VS2010, programmers don’t really have an excuse for not using tools to increase their productivity and to increase the overall quality of their work. I am a really lazy programmer, in the sense that I don’t’ like to do repetitive boring tasks. Extensions are one of the [...]<table width='100%'><tr><td align=right><p><b>(<a href='http://byteflux.me/index.php/2011/07/28/my-list-of-visual-studio-2010-extensions/' title='My list of Visual Studio 2010 Extensions'>Read more...</a>)</b></p></td></tr></table></td></tr></table>]]></description>
			<content:encoded><![CDATA[<p>I find that with the extension support in VS2010, programmers don’t really have an excuse for not using tools to increase their productivity and to increase the overall quality of their work. I am a really lazy programmer, in the sense that I don’t’ like to do repetitive boring tasks. Extensions are one of the solutions to being a happy lazy programmer. The other one is writing quality code, but that’s another story. So here is a list of all Extensions that I use in day-to-day work</p>
<p> <a href="http://dotnetshoutout.com/My-list-of-Visual-Studio-2010-Extensions" rev="vote-for"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fbyteflux.me%2Findex.php%2F2011%2F07%2F28%2Fmy-list-of-visual-studio-2010-extensions%2F" /></a> <br />  <span id="more-172"></span>
<p>&#160;</p>
<table border="1" cellspacing="0" cellpadding="2" width="948">
<tbody>
<tr>
<td valign="top" width="266">
<p><strong><font size="3">Extension</font></strong></p>
</td>
<td valign="top" width="556">
<p><strong><font size="3">Description</font></strong></p>
</td>
<td valign="top" width="124">
<p><strong><font size="3">Commercial/free</font></strong></p>
</td>
</tr>
<tr>
<td valign="top" width="266">Telerik JustCode</td>
<td valign="top" width="556">This is my main productivity tool. I really like the refactoring options, the code navigation features and the overall features it provides. Also support is very good and there are a lot of feature requests or bugs that I’ve reported to them over time and got fixed. Alternatives are CodeRush and Resharper – both are good, so in the end it’s a matter of preferences.</td>
<td valign="top" width="124">Commercial $249 / (or $199, without updates)</td>
</tr>
<tr>
<td valign="top" width="266">NuGet package manager</td>
<td valign="top" width="556">If you haven’t heard about NuGet then you probably live in a cave or you are on the wrong blog. NuGet makes it extremely simple to manage references to 3rd party libraries and updates to them.</td>
<td valign="top" width="124">Free</td>
</tr>
<tr>
<td valign="top" width="266">PowerCommands for Visual Studio 2010</td>
<td valign="top" width="556">This is a set of commands that show up in the solution explorer context menu. I use this mostly for the Close All Documents command, Open Containing Folder option, Copy Reference and Transform Templates. </td>
<td valign="top" width="124">Free</td>
</tr>
<tr>
<td valign="top" width="266">Productivity Power Tools</td>
<td valign="top" width="556">This extension actually makes Visual Studio as it should be. The two most useful features for me are the improved AddReferences dialog and the Document Tab Well. Also the solution navigator is nice, but I find it slow for big projects. </td>
<td valign="top" width="124">Free</td>
</tr>
<tr>
<td valign="top" width="266">VSCommands 2010</td>
<td valign="top" width="556">This extension also adds some new commands to the solution explorer. It also has some useful features like stop build when first project fails or colorize output messages. The extension also brings in some useful debugging features and improved colorizing in XAML files.          </p>
<p>There is a PRO version which has some nice features like reload project/solution without closing it. A very useful feature is Locate in Solution.</td>
<td valign="top" width="124">Free / Commercial (several licensing models starting at $49)</td>
</tr>
<tr>
<td valign="top" width="266">WoVS Default Browser Switcher</td>
<td valign="top" width="556">Very simple but useful extensions. Allows you to set the default browser used when launching web projects. This does not affect the default browser on your machine.</td>
<td valign="top" width="124">Free</td>
</tr>
<tr>
<td valign="top" width="266">CSharpIntellisensePresenter</td>
<td valign="top" width="556">Improved Intellisense that helps you code faster. Allows to filter intellisense results based on type (property/field/method etc.). It is a bit buggy but if you are a fast code writer this will make you go faster.</td>
<td valign="top" width="124">Free</td>
</tr>
<tr>
<td valign="top" width="266">SnippetDesigner</td>
<td valign="top" width="556">This is a useful tool to export code snippets from your current code. It makes it easier to edit the snippet definition and placeholder fields.</td>
<td valign="top" width="124">Free</td>
</tr>
<tr>
<td valign="top" width="266">XAML Intellisense Presenter</td>
<td valign="top" width="556">Improved IntelliSense for XAML files. It has some focus issues but in general it works fine and helps you a lot when working manually with XAML.</td>
<td valign="top" width="124">Free</td>
</tr>
<tr>
<td valign="top" width="266">Xaml Styler</td>
<td valign="top" width="556">Has formatting options that clean XAML files. You can choose how to align attributes etc. Very useful to clean up the markup without a lot of tedious manual work.</td>
<td valign="top" width="124">Free</td>
</tr>
<tr>
<td valign="top" width="266">devColor</td>
<td valign="top" width="556">Underlines colors in stylesheets and provides a color picker for them.</td>
<td valign="top" width="124">Free</td>
</tr>
<tr>
<td valign="top" width="266">Align Assignments</td>
<td valign="top" width="556">Allows you to allign all the assignments so that it&#160; makes it easier to use vertical selection to edit them.</td>
<td valign="top" width="124">Free</td>
</tr>
<tr>
<td valign="top" width="266">Visual Nunit 2010</td>
<td valign="top" width="556">Integrated test runner. Not really necessary if you use JustCode/ReSharper/CodeRush.</td>
<td valign="top" width="124">Free</td>
</tr>
<tr>
<td valign="top" width="266">tangible T4 Editor</td>
<td valign="top" width="556">Provides a text editor for T4 templates with IntelliSense and keyword highlighting. Has some issues though with search and replace and refactoring does not work.</td>
<td valign="top" width="124">Free / Commercial</td>
</tr>
<tr>
<td valign="top" width="266">Resource Refactoring Tool</td>
<td valign="top" width="556">Very useful features for extracting strings to resources.</td>
<td valign="top" width="124">Free</td>
</tr>
<tr>
<td valign="top" width="266">AutoCode</td>
<td valign="top" width="556">AKA. Code snippets on steroids. This extension allows you to create very complex code snippets. The free version comes with a lot of them. You can get the full version by donating to the project or by writing about it. I really like this one because it overcomes the limitations of the built in snippet functionality. The only downside with it so far is that the documentation is not really comprehensive so you have to look in their provided snippets.</td>
<td valign="top" width="124">Free / Commercial (around $10)</td>
</tr>
</tbody>
</table>
<p>I would really like more suggestions about cool extensions that you are using in your development process.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/VwJTYf0T8qUq4HkUUgci9vG_Igg/0/da"><img src="http://feedads.g.doubleclick.net/~a/VwJTYf0T8qUq4HkUUgci9vG_Igg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/VwJTYf0T8qUq4HkUUgci9vG_Igg/1/da"><img src="http://feedads.g.doubleclick.net/~a/VwJTYf0T8qUq4HkUUgci9vG_Igg/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/byteflux/kync/~4/jez7timKx38" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://byteflux.me/index.php/2011/07/28/my-list-of-visual-studio-2010-extensions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://byteflux.me/index.php/2011/07/28/my-list-of-visual-studio-2010-extensions/</feedburner:origLink></item>
		<item>
		<title>Transitioning from MSUnit to NUnit–Part 4:Code coverage</title>
		<link>http://feedproxy.google.com/~r/byteflux/kync/~3/lQdg-OBTWkc/</link>
		<comments>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-4code-coverage/#comments</comments>
		<pubDate>Wed, 18 May 2011 12:00:00 +0000</pubDate>
		<dc:creator>Sebastian Negomireanu</dc:creator>
				<category><![CDATA[Add-ins]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[ncover]]></category>
		<category><![CDATA[nunit]]></category>
		<category><![CDATA[partcover]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[unit testing]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-4code-coverage/</guid>
		<description><![CDATA[<table cellpadding='10'><tr><td valign='top' align='left'><p>Categories: <a href="http://byteflux.me/index.php/category/add-ins/" title="View all posts in Add-ins" rel="category tag">Add-ins</a>, <a href="http://byteflux.me/index.php/category/tdd/" title="View all posts in TDD" rel="category tag">TDD</a>, <a href="http://byteflux.me/index.php/category/tools/" title="View all posts in Tools" rel="category tag">Tools</a>, <a href="http://byteflux.me/index.php/category/tools/visual-studio-tools/" title="View all posts in Visual Studio" rel="category tag">Visual Studio</a></p><p>Tags: <a href="http://byteflux.me/index.php/tag/ncover/" rel="tag">ncover</a>, <a href="http://byteflux.me/index.php/tag/nunit/" rel="tag">nunit</a>, <a href="http://byteflux.me/index.php/tag/partcover/" rel="tag">partcover</a>, <a href="http://byteflux.me/index.php/tag/tdd/" rel="tag">TDD</a>, <a href="http://byteflux.me/index.php/tag/testing/" rel="tag">testing</a>, <a href="http://byteflux.me/index.php/tag/unit-testing/" rel="tag">unit testing</a>, <a href="http://byteflux.me/index.php/tag/visual-studio/" rel="tag">visual studio</a></p>When doing TDD or at least unit testing, it is necessary to know how much of your code is covered by tests and, more importantly, which code isn’t. Since we migrated to NUnit the integrated Visual Studio 2010 code coverage does not do the job anymore for us (although I’ve found several articles on how [...]<table width='100%'><tr><td align=right><p><b>(<a href='http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-4code-coverage/' title='Transitioning from MSUnit to NUnit&ndash;Part 4:Code coverage'>Read more...</a>)</b></p></td></tr></table></td></tr></table>]]></description>
			<content:encoded><![CDATA[<p>When doing TDD or at least unit testing, it is necessary to know how much of your code is covered by tests and, more importantly, which code isn’t. Since we migrated to NUnit the integrated Visual Studio 2010 code coverage does not do the job anymore for us (although I’ve found several articles on how to enable it, for some reason I couldn’t get it running).</p>
<p>There are two tools that you can use instead – one of them is NCover, which is a great tool but not free. The other one is PartCover, which is a free code coverage tool. I’ve opted to go with the latter. The main problem with PartCover is the almost non-existent documentation. After several hours of trying out different combinations of options I finally got it running and it does it job really good.</p>
<p>  <span id="more-166"></span>
<p>So first of all, download PartCover from here: <a title="https://github.com/sawilde/partcover.net4" href="https://github.com/sawilde/partcover.net4">https://github.com/sawilde/partcover.net4</a> and install it. Then, we must configure it for running our tests. Before we do this, we have to do one small step (which btw was the hardest one to find out) to make our nunit-console runner successfully run .NET 4.0 projects.</p>
<p>Open up Windows Explorer and go to your nunit installation directory (in my case it’s C:\Program Files (x86)\NUnit 2.5.10\bin\net-2.0). Open up nunit-console-x86.exe.config and add the following tag at the beginning, right after the &lt;configuration&gt; tag is opened:</p>
<p>&lt;startup&gt;   <br /> &lt;supportedRuntime version=&quot;v4.0.30319&quot; /&gt;    <br /> &lt;/startup&gt;    <br />This will make the nunit console run .NET 4.0 projects. You can do the same for all other nunit config files.</p>
<p>Once you’re done, open the PartCover browser and go to File-&gt;Run Target…</p>
<p>In the Executable file box, browse for the net-2.0\nunit-console-x86.exe file. This should also set the working directory automatically.</p>
<p>In the working arguments enter the following text (replace the solution name and path with your own, but leave the double quotes): <strong>/noshadow &quot;C:\My Projects\MyProject\MyProject.sln&quot;</strong></p>
<p>In the rules box, you need to add rules to include all assemblies that you want to check for code coverage and to exclude unnecessary assemblies. I use something like:</p>
<p>+[*MyProject*]*</p>
<p>-[*Test*]*</p>
<p>This will include all assemblies and namespaces that contiain “MyProject” in their name, but will exclude all assemblies and namespaces that contain unit tests.</p>
<p>Don’t forget to save the configuration for further use.</p>
<p>Then press start. It will run the console and show you a tree with the code and its coverage.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/FPOIac9PJibDuShvv3h7piKgNf0/0/da"><img src="http://feedads.g.doubleclick.net/~a/FPOIac9PJibDuShvv3h7piKgNf0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/FPOIac9PJibDuShvv3h7piKgNf0/1/da"><img src="http://feedads.g.doubleclick.net/~a/FPOIac9PJibDuShvv3h7piKgNf0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/byteflux/kync/~4/lQdg-OBTWkc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-4code-coverage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-4code-coverage/</feedburner:origLink></item>
		<item>
		<title>Transitioning from MSUnit to NUnit–Part 3:Integration with TFS builds</title>
		<link>http://feedproxy.google.com/~r/byteflux/kync/~3/ZgWz0ir1lik/</link>
		<comments>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-3integration-with-tfs-builds/#comments</comments>
		<pubDate>Wed, 18 May 2011 11:30:00 +0000</pubDate>
		<dc:creator>Sebastian Negomireanu</dc:creator>
				<category><![CDATA[Add-ins]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[CI]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[msunit]]></category>
		<category><![CDATA[nunit]]></category>
		<category><![CDATA[tfs]]></category>
		<category><![CDATA[unit testing]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[visualstudio]]></category>

		<guid isPermaLink="false">http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-3integration-with-tfs-builds/</guid>
		<description><![CDATA[<table cellpadding='10'><tr><td valign='top' align='left'><p>Categories: <a href="http://byteflux.me/index.php/category/add-ins/" title="View all posts in Add-ins" rel="category tag">Add-ins</a>, <a href="http://byteflux.me/index.php/category/tdd/" title="View all posts in TDD" rel="category tag">TDD</a>, <a href="http://byteflux.me/index.php/category/tools/" title="View all posts in Tools" rel="category tag">Tools</a>, <a href="http://byteflux.me/index.php/category/uncategorized/" title="View all posts in Uncategorized" rel="category tag">Uncategorized</a>, <a href="http://byteflux.me/index.php/category/tools/visual-studio-tools/" title="View all posts in Visual Studio" rel="category tag">Visual Studio</a></p><p>Tags: <a href="http://byteflux.me/index.php/tag/ci/" rel="tag">CI</a>, <a href="http://byteflux.me/index.php/tag/continuous-integration/" rel="tag">continuous integration</a>, <a href="http://byteflux.me/index.php/tag/msunit/" rel="tag">msunit</a>, <a href="http://byteflux.me/index.php/tag/nunit/" rel="tag">nunit</a>, <a href="http://byteflux.me/index.php/tag/tdd/" rel="tag">TDD</a>, <a href="http://byteflux.me/index.php/tag/tfs/" rel="tag">tfs</a>, <a href="http://byteflux.me/index.php/tag/unit-testing/" rel="tag">unit testing</a>, <a href="http://byteflux.me/index.php/tag/visual-studio/" rel="tag">visual studio</a>, <a href="http://byteflux.me/index.php/tag/visualstudio/" rel="tag">visualstudio</a></p>&#160; One of our main requirements when performing the migration was to have the same level of integration with our Team Build system. This means that the build should run all tests and fail if any test fails. Also we should be able to see in the build log which tests have failed. This step [...]<table width='100%'><tr><td align=right><p><b>(<a href='http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-3integration-with-tfs-builds/' title='Transitioning from MSUnit to NUnit&ndash;Part 3:Integration with TFS builds'>Read more...</a>)</b></p></td></tr></table></td></tr></table>]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>One of our main requirements when performing the migration was to have the same level of integration with our Team Build system. This means that the build should run all tests and fail if any test fails. Also we should be able to see in the build log which tests have failed.</p>
<p>This step is the most complicated one so here is a quick breakdown of all the steps involved:</p>
<ol>
<li>Setting up the build server </li>
<li>Changing the build template </li>
<li>Add a new ForEach sequence to iterate through all test assemblies </li>
<li>Add a sequence to run all tests in a single test assembly </li>
<li>Invoke NUnit </li>
<li>Publish NUnit results </li>
<li>Mark the build as broken if not all tests pass </li>
<li>Modify the workflow to support projects without a test settings file </li>
<li>Check in the build template file. </li>
</ol>
<p>  <span id="more-125"></span><br />
<h2>Setting up the build server</h2>
<p>The first step is to setup the build server. I have created a folder called <strong>C:\tfstools</strong> with two subdirectories: <strong>NUnit</strong> and <strong>NUnitTfs</strong>.</p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image2.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb2.png" width="162" height="212" /></a></p>
<p>The NUnit folder contains the latest release of NUnit (just the binaries, no installer) and the NUnitTfs folder contains the latest release of NUnitTFS (<a title="http://nunit4teambuild.codeplex.com/releases/view/45765" href="http://nunit4teambuild.codeplex.com/releases/view/45765">http://nunit4teambuild.codeplex.com/releases/view/45765</a>). After placing the files in there, make sure that the configuration file for NUnitTFS has the correct server address in each service endpoint.</p>
<p>There are no other configuration steps to be done on the build machine. The following steps must be done for each TFS project that uses NUnit:</p>
<p>&#160;</p>
<h2></h2>
<h2>Changing the build template</h2>
<p>The process to setup this step was mainly inspired by this blog post (<a title="http://www.heikura.info/blog/publish-nunit-test-results-as-part-of-team-build-in-team-foundation-server-2010" href="http://www.heikura.info/blog/publish-nunit-test-results-as-part-of-team-build-in-team-foundation-server-2010">http://www.heikura.info/blog/publish-nunit-test-results-as-part-of-team-build-in-team-foundation-server-2010</a>). Unfortunately, by following only the steps there I wasn’t able to setup everything correctly (that post also doesn’t go into how to run all test projects during a build), so after a lot of trial-and-error I finally managed to get the whole process running:</p>
<p>In the Team Explorer window open the source control entry for the project in which you want to enable NUnit support. Open the BuildProcessTemplate folder and check out the DefaultTemplate.xaml file.<a href="http://byteflux.me/wp-content/uploads/2011/05/image3.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb3.png" width="297" height="125" /></a></p>
<h3></h3>
<h3>Setup build arguments</h3>
<p>Open the DefaultTemplate file and on the bottom click the Arguments button. In the grid that shows up add two entries as in the following screenshot:</p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb4.png" width="1299" height="91" /></a></p>
<ul>
<li>NUnitBinaryDirectory – [In], String, “C:\tfstools\NUnit\bin\net-2.0” </li>
<li>NUnitTfsPublisherDirectory [In], String, “C:\tfstools\NUnitTfs” </li>
</ul>
<h3></h3>
<h3>Add a new foreach sequence to iterate through all test assemblies</h3>
<p>&#160;</p>
<p>Locate the sequence with the title “If testAssembly.HasTeestSettingsFile” (should be around half-way down on the whole flow).</p>
<p>In the “true” branch of the if statement you should have these two actions:</p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image5.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb5.png" width="244" height="127" /></a></p>
<p>Insert a ForEach&lt;string&gt;action above them and change the properties as follows:</p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image6.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb6.png" width="244" height="180" /></a></p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image7.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb7.png" width="244" height="81" /></a></p>
<h3>Add a sequence to run a set of tests</h3>
<p>Inside the body of the foreach, add a sequence that will hold all following steps. Change the DisplayName property to “Run NUnit tests”. Select the new sequence and open the variables grid. Add a new variable called NUnitResult, Int32. The scope should be “Run NUnit tests”:</p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image8.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb8.png" width="982" height="49" /></a></p>
<h3>Add the Invoke NUnit action</h3>
<p>In the newly created sequence add an InvokeProcess action, and inside the new action add a WriteBuildMessage and a WriteBuildError action like in the following screenshots.</p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image9.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="left" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb9.png" width="244" height="204" /></a></p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image10.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb10.png" width="839" height="261" /></a></p>
<p>&#160;</p>
<p>The properties for the WriteBuildMessage and WriteBuildError should look like this:</p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image11.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb11.png" width="589" height="133" /></a></p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image12.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb12.png" width="587" height="77" /></a></p>
<h3>Add the publish NUnit results action</h3>
<p>After the Invoke NUnit action (in the same sequence) add a new Invoke process action. Call it “Publish NUnitTests” and copy paste the inner WriteBuildMessage and WriteBuildError actions from the “Invoke NUnit” action created at the previous step. </p>
<p>Set the Arguments to: </p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image13.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb13.png" width="763" height="234" /></a></p>
<p>Set the FileName to:</p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image14.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb14.png" width="481" height="197" /></a></p>
<p>And finally, set the WorkingDirectory to outputDirectory.</p>
<h3>Add an if statement that will set the test status to error if the tests don’t pass</h3>
<p>At the end of the same sequence add an If statement. Set the condition to NUnitResult &lt;&gt; 0 and in the “Then” branch add an assign action. Set the properties as follows:</p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image15.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb15.png" width="469" height="87" /></a></p>
<p>The if action should look like this in the end: </p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image16.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb16.png" width="428" height="197" /></a></p>
<h3>Done <img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://byteflux.me/wp-content/uploads/2011/05/wlEmoticon-smile.png" /></h3>
<p>If you have followed all the above steps, you should get a sequence as in the following screenshot:</p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image17.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb17.png" width="397" height="772" /></a></p>
<h3>Wait, there’s more</h3>
<p>The above steps ensure that the Team Build server will run your NUnit tests when you have a test settings file. You have to do one more step (I promise it’s an easy one <img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://byteflux.me/wp-content/uploads/2011/05/wlEmoticon-smile.png" />) to get the tests to run also when you don’t have that file. </p>
<p>Scroll a bit above to the “If testAssembly.HasTestSettingsFile” action. Cut the “Run MSTest for Test Assemblies” action from the “Else” branch and replace it with a Sequence. Paste back the action inside the sequence. Then, Copy the “Run all NUnit tests” action from the “Then” branch and paste it above the “Run MSTest for Test Assemblies action”:</p>
<p><a href="http://byteflux.me/wp-content/uploads/2011/05/image18.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb18.png" width="393" height="710" /></a></p>
<p>The final result of the “Else” branch should look like the screenshot above.</p>
<h3></h3>
<h3>The end (for real now)</h3>
<p>Check in the DefaultTemplate.xaml file and you’re done. When you build your project now it should run all NUnit tests as part of the build process.</p>
<p>&#160;</p>
<p>Check out the next parts of this series here:</p>
<ul>
<li><a href="http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-4code-coverage/">Code coverage</a></li>
</ul>

<p><a href="http://feedads.g.doubleclick.net/~a/B7iXQI432WXKZ7FMsuFwiGLsElw/0/da"><img src="http://feedads.g.doubleclick.net/~a/B7iXQI432WXKZ7FMsuFwiGLsElw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/B7iXQI432WXKZ7FMsuFwiGLsElw/1/da"><img src="http://feedads.g.doubleclick.net/~a/B7iXQI432WXKZ7FMsuFwiGLsElw/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/byteflux/kync/~4/ZgWz0ir1lik" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-3integration-with-tfs-builds/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-3integration-with-tfs-builds/</feedburner:origLink></item>
		<item>
		<title>Transitioning from MSUnit to NUnit–Part 2:Migrating test code</title>
		<link>http://feedproxy.google.com/~r/byteflux/kync/~3/IPkNYKNuc5Y/</link>
		<comments>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-2migrating-test-code/#comments</comments>
		<pubDate>Wed, 18 May 2011 11:00:00 +0000</pubDate>
		<dc:creator>Sebastian Negomireanu</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Add-ins]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[CI]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[msunit]]></category>
		<category><![CDATA[nunit]]></category>
		<category><![CDATA[tfs]]></category>
		<category><![CDATA[unit testing]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[visualstudio]]></category>

		<guid isPermaLink="false">http://byteflux.me/?p=116</guid>
		<description><![CDATA[<table cellpadding='10'><tr><td valign='top' align='left'><p>Categories: <a href="http://byteflux.me/index.php/category/code/dotnet/" title="View all posts in .NET" rel="category tag">.NET</a>, <a href="http://byteflux.me/index.php/category/add-ins/" title="View all posts in Add-ins" rel="category tag">Add-ins</a>, <a href="http://byteflux.me/index.php/category/code/csharp/" title="View all posts in C#" rel="category tag">C#</a>, <a href="http://byteflux.me/index.php/category/code/" title="View all posts in Code" rel="category tag">Code</a>, <a href="http://byteflux.me/index.php/category/tdd/" title="View all posts in TDD" rel="category tag">TDD</a>, <a href="http://byteflux.me/index.php/category/tools/" title="View all posts in Tools" rel="category tag">Tools</a>, <a href="http://byteflux.me/index.php/category/uncategorized/" title="View all posts in Uncategorized" rel="category tag">Uncategorized</a>, <a href="http://byteflux.me/index.php/category/tools/visual-studio-tools/" title="View all posts in Visual Studio" rel="category tag">Visual Studio</a></p><p>Tags: <a href="http://byteflux.me/index.php/tag/ci/" rel="tag">CI</a>, <a href="http://byteflux.me/index.php/tag/continuous-integration/" rel="tag">continuous integration</a>, <a href="http://byteflux.me/index.php/tag/msunit/" rel="tag">msunit</a>, <a href="http://byteflux.me/index.php/tag/nunit/" rel="tag">nunit</a>, <a href="http://byteflux.me/index.php/tag/tdd/" rel="tag">TDD</a>, <a href="http://byteflux.me/index.php/tag/tfs/" rel="tag">tfs</a>, <a href="http://byteflux.me/index.php/tag/unit-testing/" rel="tag">unit testing</a>, <a href="http://byteflux.me/index.php/tag/visual-studio/" rel="tag">visual studio</a>, <a href="http://byteflux.me/index.php/tag/visualstudio/" rel="tag">visualstudio</a></p>&#160; Fortunately, this is really a very simple step (or at least in our case it was): Remove the reference to Microsoft.VisualStudio.QualityTools.UnitTestFramework and replace it with a reference to nunit.framework. If you use nuget, you can add a library reference to the NUnit package. You need to do some search &#38; replace in all files. [...]<table width='100%'><tr><td align=right><p><b>(<a href='http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-2migrating-test-code/' title='Transitioning from MSUnit to NUnit&ndash;Part 2:Migrating test code'>Read more...</a>)</b></p></td></tr></table></td></tr></table>]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Fortunately, this is really a very simple step (or at least in our case it was):</p>
<p>  <span id="more-116"></span>
<ol>
<li>Remove the reference to Microsoft.VisualStudio.QualityTools.UnitTestFramework and replace it with a reference to nunit.framework. If you use nuget, you can add a library reference to the NUnit package. </li>
<li>You need to do some search &amp; replace in all files. The table below illustrates what to search for and what to replace it with:<br />
<table border="0" cellspacing="0" cellpadding="2" width="1081">
<tbody>
<tr>
<td valign="top" width="518"><strong>Search (MSUnit code)</strong></td>
<td valign="top" width="561"><strong>Replace with (NUnit code)</strong></td>
</tr>
<tr>
<td valign="top" width="518">using Microsoft.VisualStudio.TestTools.UnitTesting;</td>
<td valign="top" width="561">using NUnit.Framework;</td>
</tr>
<tr>
<td valign="top" width="518">[TestClass]</td>
<td valign="top" width="561">[TestFixture]</td>
</tr>
<tr>
<td valign="top" width="518">[<font style="background-color: #ffffff">TestMethod]</font></td>
<td valign="top" width="561">[Test]</td>
</tr>
<tr>
<td valign="top" width="518">[TestInitialize]</td>
<td valign="top" width="561">[SetUp]</td>
</tr>
<tr>
<td valign="top" width="518">[TestCleanup]</td>
<td valign="top" width="561">[TearDown]</td>
</tr>
<tr>
<td valign="top" width="518">[ClassInitialize]</td>
<td valign="top" width="561">[TestFixtureSetUp]</td>
</tr>
<tr>
<td valign="top" width="518">[ClassCleanup]</td>
<td valign="top" width="561">[TestFixtureTearDown]</td>
</tr>
</tbody>
</table>
</li>
<li>At this step you should be almost done. One of the issues I had with the code is that I used in several places the Assert.IsInstanceOfType assertion. It seems that the NUnit assertion expects arguments in the opposite order than MSUnit. Also there is a generic Assert.IsInstanceOf&lt;&gt; method that you can use. I’ve made a search and replace regex that will fix most of these assertions in your code: <a href="http://byteflux.me/wp-content/uploads/2011/05/image1.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://byteflux.me/wp-content/uploads/2011/05/image_thumb1.png" width="468" height="441" /></a>
<p>For convenience, the search expression is: <strong>Assert\.IsInstanceOfType\({[^,:b]+}:b*,:b*typeof\({:i}\)\);          <br /></strong>and the replace expression is: <strong>Assert.IsInstanceOf&lt;\2&gt;(\1);</strong>         </p>
<p>Also, make sure you have the two checkboxes checked.</p>
</li>
<li>We also had some other errors in the tests, that required running the tests in a Single Threaded Apartment (STA) thread. To accomplish this, you need to decorate the test or the test method with the [RequiresSTA] attribute (check this link for more details: <a title="http://www.nunit.org/index.php?p=requiresSTA&amp;r=2.5" href="http://www.nunit.org/index.php?p=requiresSTA&amp;r=2.5">http://www.nunit.org/index.php?p=requiresSTA&amp;r=2.5</a>) </li>
</ol>
<p>At this stage you should be done with the migration of the test code. If there are any other issues you encounter, please let me know and I will update this blog post with the steps involved.</p>
<p>&#160;</p>
<p>Check out the next parts of this series here:</p>
<ul>
<li><a href="http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-3integration-with-tfs-builds/">Integration with TFS builds</a> </li>
<li><a href="http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-4code-coverage/">Code coverage</a></li>
</ul>

<p><a href="http://feedads.g.doubleclick.net/~a/enbV9LW9adIMfp7M3X7qC9eUz_w/0/da"><img src="http://feedads.g.doubleclick.net/~a/enbV9LW9adIMfp7M3X7qC9eUz_w/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/enbV9LW9adIMfp7M3X7qC9eUz_w/1/da"><img src="http://feedads.g.doubleclick.net/~a/enbV9LW9adIMfp7M3X7qC9eUz_w/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/byteflux/kync/~4/IPkNYKNuc5Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-2migrating-test-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-2migrating-test-code/</feedburner:origLink></item>
		<item>
		<title>Transitioning from MSUnit to NUnit–Part 1:Tools</title>
		<link>http://feedproxy.google.com/~r/byteflux/kync/~3/xfCuI9jdoTw/</link>
		<comments>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-1tools/#comments</comments>
		<pubDate>Wed, 18 May 2011 09:51:01 +0000</pubDate>
		<dc:creator>Sebastian Negomireanu</dc:creator>
				<category><![CDATA[Add-ins]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[CI]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[msunit]]></category>
		<category><![CDATA[nunit]]></category>
		<category><![CDATA[tfs]]></category>
		<category><![CDATA[unit testing]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[visualstudio]]></category>

		<guid isPermaLink="false">http://byteflux.me/?p=117</guid>
		<description><![CDATA[<table cellpadding='10'><tr><td valign='top' align='left'><p>Categories: <a href="http://byteflux.me/index.php/category/add-ins/" title="View all posts in Add-ins" rel="category tag">Add-ins</a>, <a href="http://byteflux.me/index.php/category/tdd/" title="View all posts in TDD" rel="category tag">TDD</a>, <a href="http://byteflux.me/index.php/category/tools/" title="View all posts in Tools" rel="category tag">Tools</a>, <a href="http://byteflux.me/index.php/category/uncategorized/" title="View all posts in Uncategorized" rel="category tag">Uncategorized</a>, <a href="http://byteflux.me/index.php/category/tools/visual-studio-tools/" title="View all posts in Visual Studio" rel="category tag">Visual Studio</a></p><p>Tags: <a href="http://byteflux.me/index.php/tag/ci/" rel="tag">CI</a>, <a href="http://byteflux.me/index.php/tag/continuous-integration/" rel="tag">continuous integration</a>, <a href="http://byteflux.me/index.php/tag/msunit/" rel="tag">msunit</a>, <a href="http://byteflux.me/index.php/tag/nunit/" rel="tag">nunit</a>, <a href="http://byteflux.me/index.php/tag/tdd/" rel="tag">TDD</a>, <a href="http://byteflux.me/index.php/tag/tfs/" rel="tag">tfs</a>, <a href="http://byteflux.me/index.php/tag/unit-testing/" rel="tag">unit testing</a>, <a href="http://byteflux.me/index.php/tag/visual-studio/" rel="tag">visual studio</a>, <a href="http://byteflux.me/index.php/tag/visualstudio/" rel="tag">visualstudio</a></p>&#160; Since we are not using MSBuild anymore, we need some tools to help us in the testing process. Below are the tools that I currently use for this: NUnit GUI &#38; Console runner (included in the NUnit setup) http://www.nunit.org/index.php?p=download Visual NUnit – for running and debugging tests inside Visual Studio 2010 http://www.bubblecloud.org/visualnunit (if you [...]<table width='100%'><tr><td align=right><p><b>(<a href='http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-1tools/' title='Transitioning from MSUnit to NUnit&ndash;Part 1:Tools'>Read more...</a>)</b></p></td></tr></table></td></tr></table>]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Since we are not using MSBuild anymore, we need some tools to help us in the testing process. Below are the tools that I currently use for this:</p>
<p>  <span id="more-117"></span>
<ul>
<li>NUnit GUI &amp; Console runner (included in the NUnit setup) <a title="http://www.nunit.org/index.php?p=download" href="http://www.nunit.org/index.php?p=download">http://www.nunit.org/index.php?p=download</a> </li>
<li>Visual NUnit – for running and debugging tests inside Visual Studio 2010 <a title="http://www.bubblecloud.org/visualnunit" href="http://www.bubblecloud.org/visualnunit">http://www.bubblecloud.org/visualnunit</a> (if you have a productivity tool installed, such as Telerik JustCode or JetBrains Resharper, you can use that to run tests) </li>
<li>PartCover – for test coverage (will detail setting up this tool in a later blog post) </li>
<li>NUnitForVS – one side effect of migrating existing Visual Studio test projects to NUnit was that we are able to use the integrated Visual Studio test runner. The only issue we’ve encountered is that running NUnit tests in this way is extremely slow (maybe some configuration issue?); you can check out this blog for more information <a title="http://bloggingabout.net/blogs/vagif/archive/2010/03/06/nunitforvs-integrating-nunit-tests-into-visual-studio.aspx" href="http://bloggingabout.net/blogs/vagif/archive/2010/03/06/nunitforvs-integrating-nunit-tests-into-visual-studio.aspx">http://bloggingabout.net/blogs/vagif/archive/2010/03/06/nunitforvs-integrating-nunit-tests-into-visual-studio.aspx</a> </li>
</ul>
<p>The NUnit GUI &amp; console test runner come in two flavors – AnyCPU and x86. In my project I could only run the tests using the x86 runners (I have mixed projects – some using the x86 configuration, while most are built using&#160; the Any CPU configuration).</p>
<p>Check out the next parts of this series here:</p>
<ul>
<li><a href="http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-2migrating-test-code/">Migrating test code</a> </li>
<li><a href="http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-3integration-with-tfs-builds/">Integration with TFS builds</a> </li>
<li><a href="http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-4code-coverage/">Code coverage</a></li>
</ul>

<p><a href="http://feedads.g.doubleclick.net/~a/2lc3syGgwd4jGtDchnGQzzOoBqI/0/da"><img src="http://feedads.g.doubleclick.net/~a/2lc3syGgwd4jGtDchnGQzzOoBqI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/2lc3syGgwd4jGtDchnGQzzOoBqI/1/da"><img src="http://feedads.g.doubleclick.net/~a/2lc3syGgwd4jGtDchnGQzzOoBqI/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/byteflux/kync/~4/xfCuI9jdoTw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-1tools/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-1tools/</feedburner:origLink></item>
		<item>
		<title>Transitioning from MSUnit to NUnit</title>
		<link>http://feedproxy.google.com/~r/byteflux/kync/~3/oHElTZMzYYI/</link>
		<comments>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunit/#comments</comments>
		<pubDate>Wed, 18 May 2011 08:45:28 +0000</pubDate>
		<dc:creator>Sebastian Negomireanu</dc:creator>
				<category><![CDATA[Add-ins]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[CI]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[msunit]]></category>
		<category><![CDATA[nunit]]></category>
		<category><![CDATA[tfs]]></category>
		<category><![CDATA[unit testing]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[visualstudio]]></category>

		<guid isPermaLink="false">http://byteflux.me/?p=113</guid>
		<description><![CDATA[<table cellpadding='10'><tr><td valign='top' align='left'><p>Categories: <a href="http://byteflux.me/index.php/category/add-ins/" title="View all posts in Add-ins" rel="category tag">Add-ins</a>, <a href="http://byteflux.me/index.php/category/tdd/" title="View all posts in TDD" rel="category tag">TDD</a>, <a href="http://byteflux.me/index.php/category/tools/" title="View all posts in Tools" rel="category tag">Tools</a>, <a href="http://byteflux.me/index.php/category/uncategorized/" title="View all posts in Uncategorized" rel="category tag">Uncategorized</a>, <a href="http://byteflux.me/index.php/category/tools/visual-studio-tools/" title="View all posts in Visual Studio" rel="category tag">Visual Studio</a></p><p>Tags: <a href="http://byteflux.me/index.php/tag/ci/" rel="tag">CI</a>, <a href="http://byteflux.me/index.php/tag/continuous-integration/" rel="tag">continuous integration</a>, <a href="http://byteflux.me/index.php/tag/msunit/" rel="tag">msunit</a>, <a href="http://byteflux.me/index.php/tag/nunit/" rel="tag">nunit</a>, <a href="http://byteflux.me/index.php/tag/tdd/" rel="tag">TDD</a>, <a href="http://byteflux.me/index.php/tag/tfs/" rel="tag">tfs</a>, <a href="http://byteflux.me/index.php/tag/unit-testing/" rel="tag">unit testing</a>, <a href="http://byteflux.me/index.php/tag/visual-studio/" rel="tag">visual studio</a>, <a href="http://byteflux.me/index.php/tag/visualstudio/" rel="tag">visualstudio</a></p>&#160; I am working in a large WPF project that is in a continuous evolution. Initially when we started the project we didn’t have any kind of unit testing in mind, then later we switched to an (almost) TDD approach. Since we use TFS for source control and automated builds, the natural decision was to [...]<table width='100%'><tr><td align=right><p><b>(<a href='http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunit/' title='Transitioning from MSUnit to NUnit'>Read more...</a>)</b></p></td></tr></table></td></tr></table>]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>I am working in a large WPF project that is in a continuous evolution. Initially when we started the project we didn’t have any kind of unit testing in mind, then later we switched to an (almost) TDD approach. Since we use TFS for source control and automated builds, the natural decision was to use MSUnit as the test framework. Although this approach has some benefits, after the project has grown in size we have reached several limitations. </p>
<p>  <span id="more-113"></span>
<p>Just to name a few (<em>disclaimer: I don’t want to turn this post in a flame war between MSUnit vs NUnit – I always think that you have to use the right tool for the right job</em>):</p>
<ul>
<li>the integrated test runner is slow… too slow to be able to do TDD in a reasonable timely fashion </li>
<li>lack of support for test input parameters (I know you can use databases to specify input parameters, but I find that setting up a database just to test 5 parameter combinations is a way too big overhead) </li>
<li><strong>the limited (and naïve) support for test inheritance</strong> </li>
</ul>
<p>I find the last point to be one of the most problematic limitations on large scale projects that use inheritance extensively. We’ve found several workarounds, none of which make your life easier – from duplicating similar test code to making a base class (which must be testable by itself – which increases the complexity of the tests significantly) to using T4 templates for generating similar tests. None of this approaches are really good solutions since they all increase the maintenance time and the complexity and footprint of the test code.</p>
<p>So in the end, after several discussions, we have decided to try to switch from MSUnit to NUnit. This blog is the first one in a series that covers this transition touching all important aspects of such a transition:</p>
<ol>
<li><a href="http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-1tools/">Tools</a> </li>
<li><a href="http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-2migrating-test-code/">Migrating test code</a> </li>
<li><a href="http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-3integration-with-tfs-builds/">Integration with TFS builds</a> </li>
<li><a href="http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunitpart-4code-coverage/">Code coverage</a> </li>
</ol>
<p> <a href="http://dotnetshoutout.com/Transitioning-from-MSUnit-to-NUnit" rev="vote-for"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fbyteflux.me%2Findex.php%2F2011%2F05%2F18%2Ftransitioning-from-msunit-to-nunit%2F" /></a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/xWmmuzPJcMJS4fHRZ82GEB1lwWU/0/da"><img src="http://feedads.g.doubleclick.net/~a/xWmmuzPJcMJS4fHRZ82GEB1lwWU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xWmmuzPJcMJS4fHRZ82GEB1lwWU/1/da"><img src="http://feedads.g.doubleclick.net/~a/xWmmuzPJcMJS4fHRZ82GEB1lwWU/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/byteflux/kync/~4/oHElTZMzYYI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunit/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://byteflux.me/index.php/2011/05/18/transitioning-from-msunit-to-nunit/</feedburner:origLink></item>
	</channel>
</rss>

