<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>kyleheon.com: Tag database</title>
    <link>http://www.kyleheon.com/articles/tag/database</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Random musings about anything and everything...</description>
    <item>
      <title>TeamAgile's DataRollback attribute upgraded to VS.2005, .NET 2.0 and NUnit 2.2.8</title>
      <description>&lt;p&gt;I&amp;#8217;m currently knee deep with a complete rewrite for one of our large e-commerce sites in .NET 2.0. Part of this rewrite has us finally getting unit tests into the solution.&lt;/p&gt;


	&lt;p&gt;For the past week I have been working on trying to get a framework in place that allows us to load suitable test data into the testing db for proper unit testing. For this system it is necessary due to all the intricate relationships between products, styles, skus, orders, order line items, etc.&lt;/p&gt;


	&lt;p&gt;I have been working on a framework similar to what Rails &lt;span class="caps"&gt;TDD&lt;/span&gt; offers, where you specify the fixtures required but continue to run into a strange issue that causes the code to run multiple times for each fixture, even though there is only one test in the fixture.&lt;/p&gt;


	&lt;p&gt;In an effort to get something in place for this week I began exploring what &lt;a href="http://www.teamagile.com/"&gt;Team Agile&lt;/a&gt; (found via/from Roy Osherove&amp;#8217;s &lt;a href="http://weblogs.asp.net/rosherove/"&gt;ISerializable&lt;/a&gt; blog). This has been coined &lt;a href="http://weblogs.asp.net/rosherove/archive/2004/10/05/238201.aspx"&gt;XtUnit&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Even though I met the min requirements of having &lt;span class="caps"&gt;COM&lt;/span&gt;+ 1.5 support (Windows &lt;span class="caps"&gt;XP SP2 OR&lt;/span&gt; Windows 2003) I was not able to get things to work. At first it turned out that I wasn&amp;#8217;t sub-classing &lt;code&gt;ExtensibleFixture&lt;/code&gt; but then it didn&amp;#8217;t like the version of NUnit I had.&lt;/p&gt;


	&lt;p&gt;As it turns out the source was provided using VS.2003, compiled against NUnit 2.2.1 (2.2.x for sure, believe it was 2.2.1). I&amp;#8217;m using NUnit 2.2.8 at this point so I not only upgraded the solution to VS.2005 but also recompiled using NUnit 2.2.8 and so far I think things are working quite well. The &lt;code&gt;DataRollback&lt;/code&gt; attribute is working perfectly.&lt;/p&gt;


	&lt;p&gt;This will work for now in that it at least ensures that tests are atomic, not affecting other tests. It does not however help me ensure that we have appropriate test data in the system. That currently is handled via a nant script that clones the db structure from our dev db into a new local test db and then a &lt;code&gt;data.sql&lt;/code&gt; that is run to load initial lookup data.&lt;/p&gt;


	&lt;p&gt;To make it easier for anyone struggling with the same issues I am providing the upgraded source as well as recompiled binaries for download. You can get them below.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="/files/TeamAgile-Source.zip"&gt;Source Code&lt;/a&gt; (VS.2005, .NET 2.0, NUnit 2.2.8).&lt;/li&gt;
		&lt;li&gt;&lt;a href="/files/TeamAgile-Binary.zip"&gt;Binary&lt;/a&gt; (includes NUnit 2.2.8 binary)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;If anyone can explain to me why when adding an attribute at the class level would cause this code to be executed multiple times (with just one test in the test fixture) I would love to hear about it in the comments.&lt;/p&gt;</description>
      <pubDate>Mon, 17 Dec 2007 01:22:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:6b2ea3db-4a07-4cd9-b64b-9e8d85377760</guid>
      <author>Kyle Heon</author>
      <link>http://www.kyleheon.com/articles/2007/12/17/teamagiles-datarollback-attribute-upgraded-to-vs-2005-net-2-0-and-nunit-2-2-8</link>
      <category>Development</category>
      <category>related</category>
      <category>agile</category>
      <category>teamagile</category>
      <category>database</category>
      <category>tdd</category>
      <trackback:ping>http://www.kyleheon.com/articles/trackback/133</trackback:ping>
    </item>
  </channel>
</rss>
