<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>NUnit Tips</title>
        <link>http://geekswithblogs.net/dchestnutt/category/4138.aspx</link>
        <description>NUnit Tips</description>
        <language>en-US</language>
        <copyright>Dave Chestnutt</copyright>
        <managingEditor>hlzsfc102@sneakemail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Perseverance &amp;ndash; or &amp;ndash; how to stop whining and embrace unit testing</title>
            <link>http://geekswithblogs.net/dchestnutt/archive/2009/03/28/130484.aspx</link>
            <description>&lt;p&gt;We’ve all heard the mantra – Unit Testing is good for the soul.  We hear about the goodness of things like JUnit, NUnit, and TDD from other people.&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dchestnutt/WindowsLiveWriter/JUnitNUnitlevelsofawareness_12934/image_2.png"&gt;&lt;img height="139" border="0" align="right" width="139" src="http://geekswithblogs.net/images/geekswithblogs_net/dchestnutt/WindowsLiveWriter/JUnitNUnitlevelsofawareness_12934/image_thumb.png" alt="image" style="border-width: 0px; margin: 10px 0px 10px 10px; display: inline;" title="image" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But you’re not convinced. &lt;/p&gt;
&lt;p&gt;After all, it takes more time to write unit test code – and you’d rather get on with the next feature.  Besides, whether it’s true or not, you certainly feel like your progress is measured by how many features you crank out.&lt;/p&gt;
&lt;p&gt;In my own journey, I found I went through three distinct stages to testing heaven.  Look at my “diary” for the first few unit tested projects I was on.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Stage 1: "I believe, it's stupid but I believe" &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Unit Testing, huh?  Great, now I have to spend time writing these stupid tests before I can say I’m done. It’s not really hard, but it takes additional time to create these tests. Time that I think would be better spent moving the project along with more features.  I was told to do it, so I will, but I don't see or feel the benefit yet.  I write tests because I have to.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/dchestnutt/WindowsLiveWriter/JUnitNUnitlevelsofawareness_12934/image_4.png"&gt;&lt;img height="98" border="0" align="left" width="130" src="http://geekswithblogs.net/images/geekswithblogs_net/dchestnutt/WindowsLiveWriter/JUnitNUnitlevelsofawareness_12934/image_thumb_1.png" alt="image" style="border-width: 0px; margin: 0px 10px 0px 0px; display: inline;" title="image" /&gt;&lt;/a&gt;&lt;strong&gt;Stage 2: OK, it’s good for the project &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Hmm, I added a new feature today – and someone else’s test broke.  As I checked it out, I found that indeed, I had modified some code that no longer worked for another scenario.  So, for the first time I saw a benefit from the tests.  Of course, I still think my time is better spent adding new features – but I begin to see that they’re a good thing to have, especially if other people write them.  So now I’m voluntarily writing tests for some of the new code I write.  The project is better for it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Stage 3: Hey, I can code faster&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;And gradually it happened.  Bit by bit the the second level effects of testing crept into my work.&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;I can write a small test to reproduce a bug, and I don’t need to get a whole test environment set up.  This lets me debug my solution much much faster. &lt;/li&gt;
    &lt;li&gt;I can write a small test to exercise some code that I can’t even get to from the main application yet.  This is cool, because I can implement a feature before someone else needs it.  And put it through its paces. &lt;/li&gt;
    &lt;li&gt;Now that I’ve gotten the hang of writing tests, I find it extremely easy to write lots of test cases for the same piece of functionality.  After writing the first test, it’s real easy to tweak it for many test cases.  We always talked about testing all the edge cases – now I can actually do so. &lt;/li&gt;
    &lt;li&gt;I can modify code (like redesign the innards of a class) with high confidence that I won’t break something that depends on it – because I have a set of tests to make sure I don’t break behavior.  This is where Unit Testing plus Refactoring have a real synergy.  The two combined offer a great advantage over either practice by itself.  Better quality code that’s easier to maintain. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So that’s how it finally happened. I actively use tests to develop and debug code.  In fact – TDD (writing the tests first) as a process kind of snuck up on me. I can’t imagine writing code without tests anymore.&lt;/p&gt;
&lt;p&gt;So if you’re not there yet – don’t worry.  Especially if your boss is on your case.  It’ll come.  And when it does, you’ll wonder how you ever ever did without it.&lt;/p&gt;
&lt;div&gt;&lt;em&gt;&lt;font size="1"&gt;Technorati tags: &lt;a rel="tag" href="http://technorati.com/tag/unit testing"&gt;unit testing&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/junit"&gt;junit&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/nunit"&gt;nunit&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/CodeGaffes"&gt;CodeGaffes&lt;/a&gt;&lt;/font&gt;&lt;a rel="tag" href="http://technorati.com/tag/CodeGaffes"&gt;&lt;/a&gt;&lt;/em&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130484"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130484" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/dchestnutt/aggbug/130484.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dave Chestnutt</dc:creator>
            <guid>http://geekswithblogs.net/dchestnutt/archive/2009/03/28/130484.aspx</guid>
            <pubDate>Sat, 28 Mar 2009 07:43:40 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/dchestnutt/comments/130484.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/dchestnutt/archive/2009/03/28/130484.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/dchestnutt/comments/commentRss/130484.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/dchestnutt/services/trackbacks/130484.aspx</trackback:ping>
        </item>
        <item>
            <title>NUnit - support both .NET 1.1 and 2.0 at the same time</title>
            <link>http://geekswithblogs.net/dchestnutt/archive/2006/03/07/71661.aspx</link>
            <description>&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-STYLE: italic; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;How to easily run NUnit tests in both .NET 1.1 and 2.0 environments.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;I want to run my NUnit tests! But I have a problem -- my code runs under both .NET 1.1 and 2.0 frameworks.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It is real easy to run tests from the IDE, which I do, but that means I'm only running the tests under one version of .NET.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;How can I &lt;SPAN style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;easily &lt;/SPAN&gt;run tests under &lt;SPAN style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;both &lt;/SPAN&gt;.NET frameworks?&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;I'm lazy, so it has to be easy.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So, without even resorting to the command line, here's how I do it in 3 steps:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV dir=ltr style="MARGIN-TOP: 0px; FONT-WEIGHT: bold; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;1. Running tests with the .NET 1.1 Framework&lt;/DIV&gt;
&lt;P dir=ltr style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;I use Visual Studio 2003, and the TestDriven.NET Add-in (&lt;A href="http://www.testdriven.net/"&gt;http://www.testdriven.net/&lt;/A&gt;).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I right-click on tests, projects, or the whole solution - and run my tests under .NET 1.1.&lt;/P&gt;
&lt;P dir=ltr style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV dir=ltr style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;STRONG&gt;2. Running tests with the .NET 2.0 Framework&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;P dir=ltr style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;I use the NUnit GUI app to run tests under the .NET 2.0 environment.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;To make the NUnit GUI run with .NET 2.0 framework - I modified the &lt;SPAN style="FONT-WEIGHT: bold"&gt;nunit-gui.exe.config&lt;/SPAN&gt; file so its startup section has the 2.0 runtime first:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5pt; FONT-SIZE: 10pt; BACKGROUND: #f0f0f0; PADDING-BOTTOM: 5pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; PADDING-TOP: 5pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;SPAN style="COLOR: blue"&gt;startup&lt;/SPAN&gt;&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp; &lt;FONT color=#006400&gt;&lt;EM&gt;&amp;lt;!-- NUnit will run under the first version it finds --&amp;gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp; &lt;FONT color=#0000ff&gt;&amp;lt;SUPPORTEDRUNTIME &lt;FONT&gt;version&lt;/FONT&gt;="v2.0.50727"/&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;SUPPORTEDRUNTIME &lt;FONT&gt;version&lt;/FONT&gt;="v1.1.4322" /&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;SUPPORTEDRUNTIME  &lt;FONT&gt;version&lt;/FONT&gt;="v1.0.3705" /&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;REQUIREDRUNTIME  &lt;FONT&gt;version&lt;/FONT&gt;="v1.0.3705" /&amp;gt;&lt;BR&gt;&amp;lt;&lt;SPAN style="COLOR: blue"&gt;/startup&lt;/SPAN&gt;&amp;gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;I place a shortcut to the NUnit GUI on my Quick Launch toolbar, and I'm all set.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;While it's still true that I run the tests in the IDE the most, I can easily start the NUnit GUI and fire off my tests under .NET 2.0.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;And since it's easy, I do it.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV style="MARGIN-TOP: 0px; FONT-WEIGHT: bold; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;3. Making a test conditional based on .NET framework version&lt;/DIV&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;Some of my tests only make sense under .NET 2.0, and some under 1.1.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;[They all compile under 1.1 because we support both.]&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So how do I make a few tests conditional?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This requires two things: How to detect the version of the framework in use, and how to stop NUnit from running tests that are inappropriate for the framework in use.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;I've seen a bunch of ways to detect what framework version we're actually running under.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is my favorite because it's so simple and clear:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5pt; FONT-SIZE: 10pt; BACKGROUND: #f0f0f0; PADDING-BOTTOM: 5pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; PADDING-TOP: 5pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;&lt;PRE style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;bool&lt;/SPAN&gt; IsUsingDotNet11()&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;{&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; (Environment.Version.Major == 1)&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp; (Environment.Version.Minor == 1);&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;}&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;bool&lt;/SPAN&gt; IsUsingDotNet20()&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;{&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; (Environment.Version.Major == 2)&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp; (Environment.Version.Minor == 0);&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;}&lt;/PRE&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;As far as NUnit goes, we let it run all the tests, because we add checks inside the tests to stop them if they require the "other" version of the framework.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;By using NUnit's &lt;SPAN style="FONT-WEIGHT: bold"&gt;Assert.Ignore()&lt;/SPAN&gt; method, we can give a nice message, as well as gracefully stop the test in its tracks.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5pt; FONT-SIZE: 10pt; BACKGROUND: #f0f0f0; PADDING-BOTTOM: 5pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; PADDING-TOP: 5pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;&lt;PRE style="MARGIN: 0px"&gt;[Test]&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; TestSomethingOnDotNet11Only()&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;{&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (! IsUsingDotNet11())&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Assert.Ignore&lt;/STRONG&gt;("This test is for .NET 1.1 only");&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// &amp;#8230; Rest of test code ...&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="MARGIN: 0px"&gt;}&lt;/PRE&gt;&lt;/DIV&gt;&lt;!--EndFragment--&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;There you have it.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You can adapt this technique to suit your needs.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For example, if you run your tests from a batch file, you can modify &lt;SPAN style="FONT-WEIGHT: bold"&gt;nunit-console.exe.config&lt;/SPAN&gt; to make the console run under any version of the Framework that's installed on the machine.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;The reality is that many of us have to support more than one version of the DotNET framework.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Until such support is built into Visual Studio, we'll have to resort to methods like this to test in the real world.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Hopefully this short cut will make it easy.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;So you can be lazy like me.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=71661"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=71661" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/dchestnutt/aggbug/71661.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dave Chestnutt</dc:creator>
            <guid>http://geekswithblogs.net/dchestnutt/archive/2006/03/07/71661.aspx</guid>
            <pubDate>Tue, 07 Mar 2006 23:44:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/dchestnutt/comments/71661.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/dchestnutt/archive/2006/03/07/71661.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/dchestnutt/comments/commentRss/71661.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/dchestnutt/services/trackbacks/71661.aspx</trackback:ping>
        </item>
    </channel>
</rss>