<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>James Crisp &#187; Testing</title>
	<link>http://jamescrisp.org</link>
	<description>C#, JRuby, Ruby on Rails, .NET, book reviews, film reviews, mind hacks, Wing Chun and the occasional personal bit.</description>
	<pubDate>Sun, 06 Jul 2008 00:29:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>
	<language>en</language>
			<item>
		<title>NUnit Test Runners Were Not All Made Equal</title>
		<link>http://jamescrisp.org/2008/04/08/nunit-test-runners-were-not-all-made-equal/</link>
		<comments>http://jamescrisp.org/2008/04/08/nunit-test-runners-were-not-all-made-equal/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 07:26:11 +0000</pubDate>
		<dc:creator>James</dc:creator>
		
		<category><![CDATA[Testing]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://jamescrisp.org/2008/04/08/nunit-test-runners-were-not-all-made-equal/</guid>
		<description><![CDATA[NUnit tests can be run using a variety of different runners. Some common ones are:

NUnit GUI
Test Driven .NET
Resharper test runner
NUnit MS Build Task

The NUnit GUI and Test Driven create a new instance of the test class for each test run. This leads to more isolation but potentially slower performance.
Resharper and NUnit MSBuild Task re-use the [...]]]></description>
			<content:encoded><![CDATA[<p>NUnit tests can be run using a variety of different runners. Some common ones are:</p>
<ul>
<li><a href="http://www.nunit.org/">NUnit GUI</a></li>
<li><a href="http://www.testdriven.net/">Test Driven .NET</a></li>
<li><a href="http://www.jetbrains.com/resharper/">Resharper test runner</a></li>
<li><a href="http://msbuildtasks.tigris.org/">NUnit MS Build Task</a></li>
</ul>
<p>The NUnit GUI and Test Driven create a new instance of the test class for each test run. This leads to more isolation but potentially slower performance.</p>
<p>Resharper and NUnit MSBuild Task re-use the same instance of the test class when running each test in the class. This can lead to unintended interaction between tests. Using these runners, it is vital to to assign initial values to instance variables in SetUp, rather than when they are defined or in the constructor.</p>
<p>If you use a mix of different test runners, you can end up with tests that pass on some machines and fail on others (eg, Test Driven locally works fine, but you use NUnit MSBuild Task on your build box and get intermittent failures).</p>
]]></content:encoded>
			<wfw:commentRss>http://jamescrisp.org/2008/04/08/nunit-test-runners-were-not-all-made-equal/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NUnit SetUp Attribute and Subclassed Test Cases</title>
		<link>http://jamescrisp.org/2008/04/08/nunit-setup-attribute-and-subclassed-test-cases/</link>
		<comments>http://jamescrisp.org/2008/04/08/nunit-setup-attribute-and-subclassed-test-cases/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 07:05:44 +0000</pubDate>
		<dc:creator>James</dc:creator>
		
		<category><![CDATA[Testing]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://jamescrisp.org/2008/04/08/nunit-setup-attribute-and-subclassed-test-cases/</guid>
		<description><![CDATA[If you have a ChildTestCase class that inherits from a ParentTestCase class, and both of these have a SetUp method, marked with the [SetUp] attribute, would you expect both to be called? If so, you would be sadly disappointed. Only the SetUp method of the ChildTestCase will be called, and the SetUp in the ParentTestCase [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a ChildTestCase class that inherits from a ParentTestCase class, and both of these have a SetUp method, marked with the [SetUp] attribute, would you expect both to be called? If so, you would be sadly disappointed. Only the SetUp method of the ChildTestCase will be called, and the SetUp in the ParentTestCase will be ignored. </p>
<p>According to the <a href="http://www.nunit.org/index.php?p=setup&#038;r=2.2.10">NUnit documentation on the Set Up attribute</a>, this is intended behaviour:</p>
<blockquote><p>
If you wish to add more SetUp functionality in a derived class you need to mark the method with the appropriate attribute and then call the base class method.
</p></blockquote>
<p>An alternative approach to get all your SetUps called is to have a base TestCase class define a protected virtual SetUp() (with the SetUp attribute), which all child classes override (and call base on their first line).</p>
]]></content:encoded>
			<wfw:commentRss>http://jamescrisp.org/2008/04/08/nunit-setup-attribute-and-subclassed-test-cases/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
