<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Torgeir Helgevold's Weblog</title>
	<atom:link href="http://torgeirhelgevold.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://torgeirhelgevold.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sun, 14 Jun 2009 02:47:46 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='torgeirhelgevold.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/13c427fb09f6608bc1f0b7d869d47447?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Torgeir Helgevold's Weblog</title>
		<link>http://torgeirhelgevold.wordpress.com</link>
	</image>
			<item>
		<title>Unit tests and Use Cases</title>
		<link>http://torgeirhelgevold.wordpress.com/2009/06/14/unit-tests-and-use-cases/</link>
		<comments>http://torgeirhelgevold.wordpress.com/2009/06/14/unit-tests-and-use-cases/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 02:41:47 +0000</pubDate>
		<dc:creator>torgeirhelgevold</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[ExpressUnit]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[unit tests]]></category>
		<category><![CDATA[Unit Tests Use Cases]]></category>

		<guid isPermaLink="false">http://torgeirhelgevold.wordpress.com/?p=77</guid>
		<description><![CDATA[A common challenge when writing unit tests for a large code base is keeping track of what you are testing. Without a good process for categorizing what the individual tests are actually testing, it can quickly become unmanageable. This is especially true for projects with several hundred tests.
The way I have decided to tackle this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=77&subd=torgeirhelgevold&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A common challenge when writing unit tests for a large code base is keeping track of what you are testing. Without a good process for categorizing what the individual tests are actually testing, it can quickly become unmanageable. This is especially true for projects with several hundred tests.</p>
<p>The way I have decided to tackle this challenge in ExpressUnit is through use cases. For those of you unfamiliar with the concept of use cases, here&#8217;s the Wikipedia definition:</p>
<p>“A use case in software engineering and systems engineering is a description of a system’s behavior as it responds to a request that originates from outside of that system. In other words, a use case describes &#8220;who&#8221; can do &#8220;what&#8221; with the system in question. The use case technique is used to capture a system&#8217;s behavioral requirements by detailing scenario-driven threads through the functional requirements.”</p>
<p>Source: <a href="http://en.wikipedia.org/wiki/Use_case">http://en.wikipedia.org/wiki/Use_case</a></p>
<p>Since use cases are a description of how the system should behave, I find them to be a very natural grouping for unit/integration tests. The mechanism for grouping tests by use cases in ExpressUnit is actually quite simple. I have simply extended the test attributes (UnitTest/IntegrationTest) to take in an optional use case parameter. The new syntax works as follows:</p>
<p> [UnitTest(UseCase="Confirm.Equals will return true if objects are equal")]</p>
<p>public void ConfirmDoubleObjectsAreEqualTests()</p>
<p>{</p>
<p>    Confirm.Equals(1.0, 1.0);</p>
<p>}</p>
<p>The above example is from ExpressUnit&#8217;s own Confirm test suite where all Confirm.Equals tests have been linked to the use case: &#8220;Confirm.Equals will return true if objects are equal&#8221;.</p>
<p>Version 3.2 of ExpressUnit contains a new UI window for displaying test results broken down by use cases. (See Figure1). You can navigate to this window by clicking the Use Case tab after running all your tests.</p>
<div id="attachment_78" class="wp-caption alignnone" style="width: 460px"><img class="size-full wp-image-78" title="use cases" src="http://torgeirhelgevold.files.wordpress.com/2009/06/use-cases.jpg?w=450&#038;h=242" alt="Figure1" width="450" height="242" /><p class="wp-caption-text">Figure1</p></div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/torgeirhelgevold.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/torgeirhelgevold.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/torgeirhelgevold.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/torgeirhelgevold.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/torgeirhelgevold.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/torgeirhelgevold.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/torgeirhelgevold.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/torgeirhelgevold.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/torgeirhelgevold.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/torgeirhelgevold.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=77&subd=torgeirhelgevold&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://torgeirhelgevold.wordpress.com/2009/06/14/unit-tests-and-use-cases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a51f3217677475408f784f44ae1f6a98?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">torgeirhelgevold</media:title>
		</media:content>

		<media:content url="http://torgeirhelgevold.files.wordpress.com/2009/06/use-cases.jpg" medium="image">
			<media:title type="html">use cases</media:title>
		</media:content>
	</item>
		<item>
		<title>Continuous integration: ExpressUnit and Hudson</title>
		<link>http://torgeirhelgevold.wordpress.com/2009/06/06/continuous-integration-using-hudson-and-expressunit/</link>
		<comments>http://torgeirhelgevold.wordpress.com/2009/06/06/continuous-integration-using-hudson-and-expressunit/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 00:41:10 +0000</pubDate>
		<dc:creator>torgeirhelgevold</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[ExpressUnit]]></category>
		<category><![CDATA[Hudson]]></category>

		<guid isPermaLink="false">http://torgeirhelgevold.wordpress.com/?p=68</guid>
		<description><![CDATA[To manage large software projects with many developers and a large code base, it&#8217;s very useful to automate builds and test runs through continuous integration. The most common setup is to have a continuous integration server build your source code and run all your tests on code check-in. This gives you almost immediate feedback on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=68&subd=torgeirhelgevold&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:left;">To manage large software projects with many developers and a large code base, it&#8217;s very useful to automate builds and test runs through continuous integration. The most common setup is to have a continuous integration server build your source code and run all your tests on code check-in. This gives you almost immediate feedback on whether or not your latest code check-in broke the build by either causing a compiler error or test failure.  There are several alternatives out there for continuous integration. I have chosen to integrate ExpressUnit with Hudson which is an open source continuous integration platform. The nice thing about Hudson is that it&#8217;s very easy to configure. The interface is extremely user friendly and lets you handle everything through a simple web based UI. I won&#8217;t go into much detail on how to set up Hudson as there are plenty of good tutorials available on the web. Instead I will list some of the necessary steps to integrate ExpressUnit with Hudson</p>
<p>1)Add your source code management tool through the Hudson web UI</p>
<p>2) Set up MsBuild as your source code builder (point to your solution file)</p>
<p>3) In the Windows batch command window make a call to “ExpressUnitGui.exe runtests” which triggers ExpressUnit to run and close after all tests have been run (No user interaction required)</p>
<p>4)Select to publish JUnit test result report. ExpressUnit will, when running in command line mode, generate an xml file with test results which will be picked up by Hudson and displayed in the UI. The generated xml file is compliant with the JUnit test result format required by Hudson, so Hudson will be able to display information about your test runs. You will be able to see statistics of test runs over time as well as information about why particular tests failed.</p>
<p>I am actually using ExpressUnit as my testing framework while building ExpressUnit. The following screen shot shows my ExpressUnit project on Hudson</p>
<div id="attachment_69" class="wp-caption alignnone" style="width: 460px"><img class="size-full wp-image-69" title="Hudson" src="http://torgeirhelgevold.files.wordpress.com/2009/06/hudson.jpg?w=450&#038;h=292" alt="Figure1" width="450" height="292" /><p class="wp-caption-text">Figure1</p></div>
<p>On the left you can see the build history, and over on the right is the test trend graphed over time.</p>
<p>Please drop me a line if you need more detailed instructions on how to get ExpressUnit up and running with Hudson</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/torgeirhelgevold.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/torgeirhelgevold.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/torgeirhelgevold.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/torgeirhelgevold.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/torgeirhelgevold.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/torgeirhelgevold.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/torgeirhelgevold.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/torgeirhelgevold.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/torgeirhelgevold.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/torgeirhelgevold.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=68&subd=torgeirhelgevold&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://torgeirhelgevold.wordpress.com/2009/06/06/continuous-integration-using-hudson-and-expressunit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a51f3217677475408f784f44ae1f6a98?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">torgeirhelgevold</media:title>
		</media:content>

		<media:content url="http://torgeirhelgevold.files.wordpress.com/2009/06/hudson.jpg" medium="image">
			<media:title type="html">Hudson</media:title>
		</media:content>
	</item>
		<item>
		<title>Is pure TDD practical?</title>
		<link>http://torgeirhelgevold.wordpress.com/2008/07/21/is-pure-tdd-practical/</link>
		<comments>http://torgeirhelgevold.wordpress.com/2008/07/21/is-pure-tdd-practical/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 00:19:40 +0000</pubDate>
		<dc:creator>torgeirhelgevold</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Test Driven Development]]></category>

		<guid isPermaLink="false">http://torgeirhelgevold.wordpress.com/?p=18</guid>
		<description><![CDATA[ 
As a software developer I have always considered unit testing an important asset to programming. Most developers who do unit testing will naturally develop their own style and technique for writing tests. However many have started to embrace a new paradigm called Test Driven Development (TDD).
TDD mandates that the unit test must be written before the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=18&subd=torgeirhelgevold&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p> </p>
<p style="margin-bottom:0;">As a software developer I have always considered unit testing an important asset to programming. Most developers who do unit testing will naturally develop their own style and technique for writing tests. However many have started to embrace a new paradigm called Test Driven Development (TDD).</p>
<p style="margin-bottom:0;">TDD mandates that the unit test must be written before the actual implementation of the code you are testing. I like this idea in principle, but I argue that it might not always be practical. Instead I practice what I call ATDD – Almost Test Driven Development. The difference is that I implement my code before writing the unit test, but I always envision what the test will look like before writing any code. When creating the test, I may also debug into my new code to capture output that I can use in the Assert statement of my test. This clearly violates the TDD paradigm since I already have an implementation to test. However, I feel this is more practical since it may save me a lot of typing if the result value of my code is complex and hard to produce manually. This is especially true if the output is a long complex string / xml. It is of course very important to be very careful when manually inspecting the result of the method.</p>
<p style="margin-bottom:0;">Another problem I have with the pure TDD approach is compilation overhead. In large .Net solutions it is not always practical to compile and re-run your tests for every little change you make to a method while it is being created. I therefore believe the most practical approach is to implement your code first, but do so with the unit test in mind.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/torgeirhelgevold.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/torgeirhelgevold.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/torgeirhelgevold.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/torgeirhelgevold.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/torgeirhelgevold.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/torgeirhelgevold.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/torgeirhelgevold.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/torgeirhelgevold.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/torgeirhelgevold.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/torgeirhelgevold.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/torgeirhelgevold.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/torgeirhelgevold.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=18&subd=torgeirhelgevold&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://torgeirhelgevold.wordpress.com/2008/07/21/is-pure-tdd-practical/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a51f3217677475408f784f44ae1f6a98?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">torgeirhelgevold</media:title>
		</media:content>
	</item>
		<item>
		<title>Bulk Insert Sql Server</title>
		<link>http://torgeirhelgevold.wordpress.com/2008/06/04/bulk-insert-sql-server/</link>
		<comments>http://torgeirhelgevold.wordpress.com/2008/06/04/bulk-insert-sql-server/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 04:46:37 +0000</pubDate>
		<dc:creator>torgeirhelgevold</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Bulk Insert]]></category>
		<category><![CDATA[Sql Server]]></category>

		<guid isPermaLink="false">http://torgeirhelgevold.wordpress.com/?p=13</guid>
		<description><![CDATA[In one of my recent projects I needed to import data from tab delimited files into an SQL Server database. I decided to go with the Bulk Insert option. Bulk Insert is a neat little T-SQL function that lets you import tabular data from a structured file to a corresponding database table.
Here&#8217;s an example of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=13&subd=torgeirhelgevold&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In one of my recent projects I needed to import data from tab delimited files into an SQL Server database. I decided to go with the Bulk Insert option. Bulk Insert is a neat little T-SQL function that lets you import tabular data from a structured file to a corresponding database table.</p>
<p style="margin-bottom:0;">Here&#8217;s an example of how to use Bulk Insert</p>
<p style="margin-bottom:0;">BULK INSERT Customer<br />
FROM &#8216;c:\import\customer.txt&#8217;<br />
WITH<br />
(<br />
  KEEPNULLS,<br />
  FIELDTERMINATOR =&#8217;\t&#8217;,<br />
  ROWTERMINATOR =&#8217; \n&#8217;</p>
<p style="margin-bottom:0;">)</p>
<p style="margin-bottom:0;">The above code samples imports tabular customer data from customer.txt, and inserts it into the Customer table.  It&#8217;s important that the column in both the file and the table are in the same order.</p>
<p style="margin-bottom:0;">My project called for a tab delimited file, but you can use whatever delimiter you like. Other typical formats you might see are comma separated files (csv) and | separated files.</p>
<p style="margin-bottom:0;">One thing to keep in mind: Don&#8217;t represent null values using some variation of a “null” – string since this will be seen as a regular string, which will fail if you try to insert it into a non char column (or a char column too small to hold your null string). You should instead leave it as an empty value in your delimited file.</p>
<p style="margin-bottom:0;">More information and documentation can be found here:</p>
<p style="margin-bottom:0;"><a href="http://msdn.microsoft.com/en-us/library/ms188365.aspx">http://msdn.microsoft.com/en-us/library/ms188365.aspx</a></p>
<p style="margin-bottom:0;"> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/torgeirhelgevold.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/torgeirhelgevold.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/torgeirhelgevold.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/torgeirhelgevold.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/torgeirhelgevold.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/torgeirhelgevold.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/torgeirhelgevold.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/torgeirhelgevold.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/torgeirhelgevold.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/torgeirhelgevold.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/torgeirhelgevold.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/torgeirhelgevold.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=13&subd=torgeirhelgevold&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://torgeirhelgevold.wordpress.com/2008/06/04/bulk-insert-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a51f3217677475408f784f44ae1f6a98?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">torgeirhelgevold</media:title>
		</media:content>
	</item>
		<item>
		<title>Unit Testing in Visual Studio Express 2008</title>
		<link>http://torgeirhelgevold.wordpress.com/2008/05/31/unit-testing-in-visual-studio-express-2008/</link>
		<comments>http://torgeirhelgevold.wordpress.com/2008/05/31/unit-testing-in-visual-studio-express-2008/#comments</comments>
		<pubDate>Sat, 31 May 2008 04:51:23 +0000</pubDate>
		<dc:creator>torgeirhelgevold</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Continuous Integration Visual Studio Express]]></category>
		<category><![CDATA[Debug Unit Tests]]></category>
		<category><![CDATA[ExpressUnit]]></category>
		<category><![CDATA[Run tests on check-in Visual Studio Express]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[TDD Visual Studio]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[Torgeir Helgevold]]></category>
		<category><![CDATA[Unit test]]></category>
		<category><![CDATA[Unit testing Visual Studio Express]]></category>
		<category><![CDATA[Unit Testing Visual Studio Express 2008]]></category>

		<guid isPermaLink="false">http://torgeirhelgevold.wordpress.com/?p=10</guid>
		<description><![CDATA[In an earlier blog post I described how to use Nunit for unit testing in Visual Studio Express. One short coming of this strategy is that you can&#8217;t easily debug your tests. This is because Visual Studio Express doesn&#8217;t seem to let you attach external processes. (We would need to attach the external Nunit process [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=10&subd=torgeirhelgevold&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div class="mceTemp"><span style="font-size:small;">In an earlier blog post I described how to use Nunit for unit testing in Visual Studio Express. One short coming of this strategy is that you can&#8217;t easily debug your tests. This is because Visual Studio Express doesn&#8217;t seem to let you attach external processes. (We would need to attach the external Nunit process to step into the code).</span></div>
<p><span style="font-size:small;">To get around this rather annoying problem, I have created my own testing framework; ExpressUnit. The current version of ExpressUnit is now 3.x. The latest version offers two new benefits over previous versions:</span></p>
<ol>
<li><span style="font-size:small;">The new UI interface has been created using WPF</span></li>
<li><span style="font-size:small;"> ExpressUnit 3.x supports continuous integration with Hudson which means you can use ExpressUnit to run your  tests on your build server. In my current development environment I have configured ExpressUnit to run all tests on every code check-in. My continuous Integration environment is currently set up using Subversion, Hudson and ExpressUnit.<br />
</span></li>
</ol>
<p><span style="font-size:small;">Instead of relying on an external application to run the tests, ExpressUnit will run from within your Visual Studio Solution. The idea is that you download ExpressUnit in the form of a Visual Studio project and add it to your solution.</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">The added project becomes your unit test project where you may add your test classes with the belonging unit tests. No configuration is required. </span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">To add tests, simply add a test class with public test methods. The class and methods must be decorated with the </span><span style="color:#000000;"><span style="font-size:small;">[</span></span><span style="color:#2b91af;"><span style="font-size:small;">TestClass</span></span><span style="color:#000000;"><span style="font-size:small;">] and [</span></span><span style="color:#2b91af;"><span style="font-size:small;">UnitTest</span></span><span style="color:#000000;"><span style="font-size:small;">]/[</span></span><span style="color:#2b91af;"><span style="font-size:small;">ItegrationTest</span></span><span style="color:#000000;"> </span><span style="color:#000000;"><span style="font-size:small;">] attributes respectively. The unit test attribute should be used for unit tests and the Integration test attribute is meant for integration tests. ExpressUnit will let you filter test runs on these attributes.<br />
</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:small;">It&#8217;s usually my preference to add all my tests to the ExpressUnit project, but ExpressUnit allows for tests to be defined in any project in your solution (as long as the ExpressUnit project has a reference to it). </span></span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">Anyway, that&#8217;s enough background information! To make this as useful as possible I will demonstrate how to use ExpressUnit through an example.</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;"><strong>Step1:</strong></span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">Download ExpressUnitGui from </span></p>
<p style="margin-bottom:0;"><span style="color:#000080;"><span style="text-decoration:underline;"><a href="http://code.google.com/p/expressunit/"><span style="font-size:small;">http://code.google.com/p/expressunit/</span></a></span></span></p>
<p style="margin-bottom:0;"><span style="font-size:small;"><strong>Step2:</strong></span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">Add the ExpressUnitGui project to your already existing Visual Studio 2008 solution.</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">After completing this step, your solution will look similar to Figure1</span></p>
<div id="attachment_33" class="wp-caption alignnone" style="width: 256px"><img class="size-full wp-image-33" title="solutionimage11" src="http://torgeirhelgevold.files.wordpress.com/2008/05/solutionimage11.jpg?w=246&#038;h=436" alt="Figure1" width="246" height="436" /><p class="wp-caption-text">Figure1</p></div>
<div class="mceTemp"><span style="font-size:small;"><strong>Step3:</strong></span></div>
<p style="margin-bottom:0;"><span style="font-size:small;">Start writing your first ExpressUnit test.</span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:small;">As mentioned earlier, you must start by adding a test class with at least one test method to the ExpressUnitGui project. The class may look something like the following:</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:small;"><span style="font-size:x-small;"><span>[</span></span><span style="color:#2b91af;"><span style="font-size:x-small;"><span>TestClass</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span>]</span></span></span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;"><span>public</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span> </span></span></span><span style="color:#0000ff;"><span style="font-size:x-small;"><span>class</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span> </span></span></span><span style="color:#2b91af;"><span style="font-size:x-small;"><span>SampleTest</span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">{</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;"><span> [</span></span></span><span style="color:#2b91af;"><span style="font-size:x-small;"><span>UnitTest</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span>]</span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;"><span> public</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span> </span></span></span><span style="color:#0000ff;"><span style="font-size:x-small;"><span>void</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span> AddTest()</span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;"> {</span></span></p>
<p style="margin-bottom:0;"><span style="color:#2b91af;"><span style="font-size:x-small;"><span> MathClass</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span> math = </span></span></span><span style="color:#0000ff;"><span style="font-size:x-small;"><span>new</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span> </span></span></span><span style="color:#2b91af;"><span style="font-size:x-small;"><span>MathClass</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span>();</span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#2b91af;"><span style="font-size:x-small;"><span> Confirm</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span>.Equals(4,math.Add(1,3));</span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;"> }</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;"><span>}</span></span></span></p>
<p style="margin-bottom:0;"><span style="font-size:small;"><strong>Step4:</strong></span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">Run your test!</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;"><span>To run your tests, select ExpressUnitGui as your startup project and press F5</span></span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">The UI window will load with a simple interface to execute one or more of your tests. (Figure2). You may run entire test suits or individual test by right clicking the appropriate tree node in the tree view, but to run all tests at once, all you have to do is click the green &#8220;Play&#8221; button. The test results are shown in the right pane, and as you can see in Figure2, each test result offers an expand button to view more details about failing tests. </span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">There is also an option to run all tests automatically on start-up of ExpressUnit. This feature is controlled by the runTestsOnStartup flag in the application&#8217;s App.Config (Default value is false)</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;"> </span></p>
<div id="attachment_65" class="wp-caption alignnone" style="width: 460px"><img class="size-full wp-image-65" title="ExpressUnit3.1" src="http://torgeirhelgevold.files.wordpress.com/2008/05/expressunit3-1.jpg?w=450&#038;h=284" alt="Figure2" width="450" height="284" /><p class="wp-caption-text">Figure2</p></div>
<p><strong> </strong></p>
<p><strong>API</strong></p>
<p style="margin-bottom:0;"><span style="font-size:small;">The following is an overview of the API offered by ExpressUnit</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;"><strong>Confirm methods</strong></span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">The confirm class contains several static methods used to confirm the outcome of your tests</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">Confirm.Equals(object obj1, object obj2):</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">This method compares two objects for equality by using the object&#8217;s own Equals implementation.</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">Confirm.Equals will throw EqualsException if the two objects are not equal. </span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">Confirm.Different(object obj1, object obj2):</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">This method is the inverse of Confirm.Equals, and is used to check if two objects are unequal.</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">UnEqualityException is thrown if the two objects are equal.</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">Confirm.IsGreater(long/double val1, long/double val2)</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">This method is used to test if val1 is numerical bigger than val2</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">Confirm.SameCollections(IEnumerable param1, IEnumerable param2)</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">This method will test if two objects of type IEnumerable are the “same”, and the definition of “same” is that all contained objects are equal.(based on the contained object&#8217;s own Equal implementation. For example, it may be used to compare the content of two arrays or collections.</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">EqualityException is thrown if the two instances are not the “same”.</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">Confirm.ExceptionThrown(</span><span style="color:#2b91af;"><span style="font-size:small;"><span>Type</span></span></span><span style="color:#000000;"><span style="font-size:small;"><span> expectedExceptionType,</span></span></span><span style="color:#2b91af;"><span style="font-size:small;"><span>TargetMethod</span></span></span><span style="color:#000000;"><span style="font-size:small;"><span> target</span></span></span><span style="font-size:small;">)</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">This method will check if the target method throws the expected exception. The target method is passed in as a delegate of type TargetMethod.</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;"><strong>Attributes</strong></span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">The following are attributes defined by ExpressUnit</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">[TestClass]</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">This attribute defines a class as a test class.</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">[UnitTest]</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">This attribute defines a method as a unit test</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">[IntegrationTest]</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">This attribute defines a method as an integration test<br />
</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">[Ignore]</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">This attribute will cause a test to be ignored when running your tests</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">[ExceptionThrown(Type exceptionType)]</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">This attribute can be put on a test to indicate that an exception of type exceptionType is expected to be thrown. The test will fail if the exception is not thrown.</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;"><strong>Conclusion</strong></span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">If this this article has made you curious about ExpressUnit, you may download it from</span></p>
<p style="margin-bottom:0;"><span style="font-size:small;"><span style="color:#000080;"><span style="text-decoration:underline;"><a href="http://code.google.com/p/expressunit/">http://code.google.com/p/expressunit/</a></span></span></span></p>
<p style="margin-bottom:0;"><span style="font-size:small;">Don&#8217;t hesitate to drop me a line if you have comments or would like to see additional functionality in ExpressUnit.</span></p>
<div class="mceTemp"><strong> </strong></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/torgeirhelgevold.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/torgeirhelgevold.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/torgeirhelgevold.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/torgeirhelgevold.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/torgeirhelgevold.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/torgeirhelgevold.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/torgeirhelgevold.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/torgeirhelgevold.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/torgeirhelgevold.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/torgeirhelgevold.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/torgeirhelgevold.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/torgeirhelgevold.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=10&subd=torgeirhelgevold&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://torgeirhelgevold.wordpress.com/2008/05/31/unit-testing-in-visual-studio-express-2008/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a51f3217677475408f784f44ae1f6a98?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">torgeirhelgevold</media:title>
		</media:content>

		<media:content url="http://torgeirhelgevold.files.wordpress.com/2008/05/solutionimage11.jpg" medium="image">
			<media:title type="html">solutionimage11</media:title>
		</media:content>

		<media:content url="http://torgeirhelgevold.files.wordpress.com/2008/05/expressunit3-1.jpg" medium="image">
			<media:title type="html">ExpressUnit3.1</media:title>
		</media:content>
	</item>
		<item>
		<title>Unit testing in Visual Studio Express II</title>
		<link>http://torgeirhelgevold.wordpress.com/2008/05/16/unit-testing-in-visual-studio-express-ii/</link>
		<comments>http://torgeirhelgevold.wordpress.com/2008/05/16/unit-testing-in-visual-studio-express-ii/#comments</comments>
		<pubDate>Fri, 16 May 2008 03:35:12 +0000</pubDate>
		<dc:creator>torgeirhelgevold</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Automated]]></category>
		<category><![CDATA[Torgeir Helgevold]]></category>
		<category><![CDATA[Unit testing in Visual Studio Express]]></category>

		<guid isPermaLink="false">http://torgeirhelgevold.wordpress.com/?p=9</guid>
		<description><![CDATA[In a previous blog entry, I talked about how you can add unit testing capability to projects in Visual Studio Express by using Nunit.
Instead of using the Nunit Gui client, you can automate the test run by using a post build event and the console version of the Nunit client.
To automatically run your tests when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=9&subd=torgeirhelgevold&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In a previous <a href="http://torgeirhelgevold.wordpress.com/2008/05/12/unit-testing-in-visual-studio-express/">blog entry, </a>I talked about how you can add unit testing capability to projects in Visual Studio Express by using Nunit.</p>
<p style="margin-bottom:0;">Instead of using the Nunit Gui client, you can automate the test run by using a post build event and the console version of the Nunit client.</p>
<p style="margin-bottom:0;">To automatically run your tests when building: Add the following line to your Visual Studio post build event:</p>
<p style="margin-bottom:0;">&#8220;[Local Nunit path]\nunit-console.exe&#8221; $(TargetDir)MyTests.dll /xml $(TargetDir)results.xml</p>
<p style="margin-bottom:0;">This will start Nunit (behind the scenes), and run all tests defined in MyTests.dll. The test results are written to results.xml.<br />
It is worth noting that the build will fail if any of the unit tests fail.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/torgeirhelgevold.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/torgeirhelgevold.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/torgeirhelgevold.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/torgeirhelgevold.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/torgeirhelgevold.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/torgeirhelgevold.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/torgeirhelgevold.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/torgeirhelgevold.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/torgeirhelgevold.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/torgeirhelgevold.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/torgeirhelgevold.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/torgeirhelgevold.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=9&subd=torgeirhelgevold&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://torgeirhelgevold.wordpress.com/2008/05/16/unit-testing-in-visual-studio-express-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a51f3217677475408f784f44ae1f6a98?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">torgeirhelgevold</media:title>
		</media:content>
	</item>
		<item>
		<title>Linq</title>
		<link>http://torgeirhelgevold.wordpress.com/2008/05/14/linq/</link>
		<comments>http://torgeirhelgevold.wordpress.com/2008/05/14/linq/#comments</comments>
		<pubDate>Wed, 14 May 2008 04:49:06 +0000</pubDate>
		<dc:creator>torgeirhelgevold</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Linq]]></category>
		<category><![CDATA[Torgeir Helgevold]]></category>

		<guid isPermaLink="false">http://torgeirhelgevold.wordpress.com/?p=8</guid>
		<description><![CDATA[Version 3.5 of the .Net framework introduced Linq as new way of dealing with object models.
I haven&#8217;t had time to play with Linq extensively, but my impression so far is good.
Linq uses a model where content from your data source is mapped into objects, or entities if you like that notation better.
A typically Linq scenario [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=8&subd=torgeirhelgevold&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Version 3.5 of the .Net framework introduced Linq as new way of dealing with object models.</p>
<p style="margin-bottom:0;">I haven&#8217;t had time to play with Linq extensively, but my impression so far is good.</p>
<p style="margin-bottom:0;">Linq uses a model where content from your data source is mapped into objects, or entities if you like that notation better.</p>
<p style="margin-bottom:0;">A typically Linq scenario is to build an object model around a relational database where each table will be represented by a typed object in your object model. The Linq framework will aid you in generating the actual entity classes and all CRUD statements. The framework will also maintain/expose a data context which serves both as your connection to the database, and your channel for invoking actions on your data source. The data context will do all the book-keeping of object state (insert, update, delete) as well. The only requirement is that you keep the context “alive” until all changes have been submitted to the database.</p>
<p style="margin-bottom:0;">Linq can also work with other data sources such as Xml, but if you ask me; its real strength comes from the ability to query typed objects in collections. Any collection implementing IEnumerable&lt;T&gt; can be queried using Linq. This can save you a lot of “foreaching” when trying to filter a collection based on specific parameters.</p>
<p style="margin-bottom:0;">The syntax of a Linq query resembles Sql syntax, which makes it an easy transition if you have some experience writing basic Sql.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/torgeirhelgevold.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/torgeirhelgevold.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/torgeirhelgevold.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/torgeirhelgevold.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/torgeirhelgevold.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/torgeirhelgevold.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/torgeirhelgevold.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/torgeirhelgevold.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/torgeirhelgevold.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/torgeirhelgevold.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/torgeirhelgevold.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/torgeirhelgevold.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=8&subd=torgeirhelgevold&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://torgeirhelgevold.wordpress.com/2008/05/14/linq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a51f3217677475408f784f44ae1f6a98?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">torgeirhelgevold</media:title>
		</media:content>
	</item>
		<item>
		<title>Unit testing in Visual Studio Express</title>
		<link>http://torgeirhelgevold.wordpress.com/2008/05/12/unit-testing-in-visual-studio-express/</link>
		<comments>http://torgeirhelgevold.wordpress.com/2008/05/12/unit-testing-in-visual-studio-express/#comments</comments>
		<pubDate>Mon, 12 May 2008 03:46:31 +0000</pubDate>
		<dc:creator>torgeirhelgevold</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://torgeirhelgevold.wordpress.com/?p=6</guid>
		<description><![CDATA[Visual Studio Express is a scaled down version of Visual Studio. The product is available for free, and can be downloaded from Microsoft. However, the product has one serious short coming; it doesn&#8217;t support unit testing!
It is unfortunate that Microsoft has excluded unit testing from Visual Studio Express, but there is still hope for those [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=6&subd=torgeirhelgevold&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Visual Studio Express is a scaled down version of Visual Studio. The product is available for free, and can be downloaded from Microsoft. However, the product has one serious short coming; it doesn&#8217;t suppo<a href="http://torgeirhelgevold.files.wordpress.com/2008/05/n.jpg"></a>rt unit testing!</p>
<p>It is unfortunate that Microsoft has excluded unit testing from Visual Studio Express, but there is still hope for those of you who want to do Test Driven Development. The solution is to add a third party unit testing framework. I have looked into Nunit, which can be downloaded for free from <a href="http://www.nunit.org/index.php">http://www.nunit.org/index.php</a></p>
<p style="margin-bottom:0;">To write unit tests in Visual Studio Express using Nunit, follow the following steps.</p>
<ol>
<li>
<p style="margin-bottom:0;">Download Nunit from <a href="http://www.nunit.org/index.php">http://www.nunit.org/index.php</a></p>
</li>
<li>
<p style="margin-bottom:0;">Create a class library project in Visual Studio Express</p>
</li>
<li>
<p style="margin-bottom:0;">Add a reference to nunit.framework.dll (This file was downloaded as part of step 1)</p>
</li>
<li>
<p style="margin-bottom:0;">Write your test code.</p>
</li>
</ol>
<p style="margin-bottom:0;">The test code follows the following format:</p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;"><span>using</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span> NUnit.Framework;</span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;"><span>namespace</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span> UnitTests</span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">{</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;"><span>[</span></span></span><span style="color:#2b91af;"><span style="font-size:x-small;"><span>TestFixture</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span>()]</span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;"><span>public</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span> </span></span></span><span style="color:#0000ff;"><span style="font-size:x-small;"><span>class</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span> </span></span></span><span style="color:#2b91af;"><span style="font-size:x-small;"><span>UnitTest</span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">{</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;"><span>       [</span></span></span><span style="color:#2b91af;"><span style="font-size:x-small;"><span>Test</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span>]</span></span></span></p>
<p style="padding-left:30px;margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;"><span>public</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span> </span></span></span><span style="color:#0000ff;"><span style="font-size:x-small;"><span>void</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span> TestAdd()</span></span></span></p>
<p style="padding-left:30px;margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">{</span></span></p>
<p style="padding-left:30px;margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;"><span>     int</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span> a = 4 + 4;</span></span></span></p>
<p style="padding-left:30px;margin-bottom:0;"><span style="color:#2b91af;"><span style="font-size:x-small;"><span>     Assert</span></span></span><span style="color:#000000;"><span style="font-size:x-small;"><span>.AreEqual(8, a);</span></span></span></p>
<p style="padding-left:30px;margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;"><span>}</span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;"><span>}</span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:small;"><span>Start the Nunit GUI application, and open the class project which was created as part of step 2).</span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:small;"><span>Your tests can be run from the Nunit GUI application, as shown in the following screenshot.</span></span></span></p>
<p style="margin-bottom:0;"><a href="http://torgeirhelgevold.files.wordpress.com/2008/05/n.jpg"><img class="alignnone size-medium wp-image-7" src="http://torgeirhelgevold.files.wordpress.com/2008/05/n.jpg?w=300&#038;h=202" alt="" width="300" height="202" /></a></p>
<p style="margin-bottom:0;"> An alternative to NUnit can be found here:</p>
<p style="margin-bottom:0;"><a href="http://torgeirhelgevold.wordpress.com/2008/05/31/unit-testing-in-visual-studio-express-2008/">http://torgeirhelgevold.wordpress.com/2008/05/31/unit-testing-in-visual-studio-express-2008/</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/torgeirhelgevold.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/torgeirhelgevold.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/torgeirhelgevold.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/torgeirhelgevold.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/torgeirhelgevold.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/torgeirhelgevold.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/torgeirhelgevold.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/torgeirhelgevold.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/torgeirhelgevold.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/torgeirhelgevold.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/torgeirhelgevold.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/torgeirhelgevold.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=6&subd=torgeirhelgevold&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://torgeirhelgevold.wordpress.com/2008/05/12/unit-testing-in-visual-studio-express/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a51f3217677475408f784f44ae1f6a98?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">torgeirhelgevold</media:title>
		</media:content>

		<media:content url="http://torgeirhelgevold.files.wordpress.com/2008/05/n.jpg?w=300" medium="image" />
	</item>
		<item>
		<title>Removing data dependency in unit tests</title>
		<link>http://torgeirhelgevold.wordpress.com/2008/05/11/removing-data-dependency-when-writing-unit-tests/</link>
		<comments>http://torgeirhelgevold.wordpress.com/2008/05/11/removing-data-dependency-when-writing-unit-tests/#comments</comments>
		<pubDate>Sun, 11 May 2008 21:30:04 +0000</pubDate>
		<dc:creator>torgeirhelgevold</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Mocking]]></category>
		<category><![CDATA[removing data dependency]]></category>
		<category><![CDATA[Torgeir Helgevold]]></category>
		<category><![CDATA[unit tests]]></category>

		<guid isPermaLink="false">http://torgeirhelgevold.wordpress.com/?p=5</guid>
		<description><![CDATA[A common problem when writing unit tests is data dependency. Typically, when you are writing tests for a method, the same method is making a call to another method which makes a call to some external data source. Code listing 1 illustrates this: The SellStock method depends on the value returned from StockService. 
Code Listing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=5&subd=torgeirhelgevold&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="font-size:x-small;">A common problem when writing<span><span style="font-size:x-small;"> unit tests is data dependency. Typically, when you are writing tests for a method, the same method is making a call to another method which makes a call to some external data source. Code listing 1 illustrates this: The SellStock method depends on the value returned from StockService. </span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">Code Listing 1</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">public</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">class</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#2b91af;"><span style="font-size:x-small;">Trader</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">{</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">private</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">int</span></span><span style="color:#000000;"><span style="font-size:x-small;"> limit = 50;</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">public</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">bool </span></span><span style="color:#000000;"><span style="font-size:x-small;">SellStock(</span></span><span style="color:#0000ff;"><span style="font-size:x-small;">string</span></span><span style="color:#000000;"><span style="font-size:x-small;">stockName)</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">{</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">     int </span></span><span style="color:#000000;"><span style="font-size:x-small;">stockValue = </span></span><span style="color:#2b91af;"><span style="font-size:x-small;">StockService</span></span><span style="color:#000000;"><span style="font-size:x-small;">.GetStockValue(stockName);</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">     if</span></span><span style="color:#000000;"><span style="font-size:x-small;">(stockValue &gt; limit)</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">     {</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">          return</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">true</span></span><span style="color:#000000;"><span style="font-size:x-small;">;</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">     }</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">     return</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">false</span></span><span style="color:#000000;"><span style="font-size:x-small;">;</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">}</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">}</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">I feel this dependency is undesirable in the context of a unit test, and the following is a technique I commonly use to remove this dependency:</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">Instead of calling </span></span><span style="color:#2b91af;"><span style="font-size:x-small;">StockService</span></span><span style="color:#000000;"><span style="font-size:x-small;">.GetStockValue directly, I move the call into a protected virtual method: </span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">Code Listing 2</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">public</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">class</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#2b91af;"><span style="font-size:x-small;">Trader</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">{</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">private</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">int</span></span><span style="color:#000000;"><span style="font-size:x-small;"> limit = 50;</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">public</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">bool </span></span><span style="color:#000000;"><span style="font-size:x-small;">SellStock(</span></span><span style="color:#0000ff;"><span style="font-size:x-small;">string</span></span><span style="color:#000000;"><span style="font-size:x-small;">stockName)</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">{</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">     int</span></span><span style="color:#000000;"><span style="font-size:x-small;">stockValue = GetStockValue(stockName);</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">     if</span></span><span style="color:#000000;"><span style="font-size:x-small;">(stockValue &gt; limit)</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">     {</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">          return</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">true</span></span><span style="color:#000000;"><span style="font-size:x-small;">;</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">     }</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">     return</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">false</span></span><span style="color:#000000;"><span style="font-size:x-small;">;</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">}</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;"><span style="color:#0000ff;">protected virtual</span> <span style="color:#0000ff;">int</span>GetStockValue(<span style="color:#0000ff;">string</span>stockName)</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">{</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;"><span style="color:#0000ff;">     return </span><span style="color:#2b91af;">StockService</span>.GetStockValue(stockName); </span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">}</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">}</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">The idea is that the test class can inherit the Trader class, and override GetStockVaule to return a predefined value. </span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">Code listing3 illustrates this:</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">Code Listing 3</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">public</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">class</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#2b91af;"><span style="font-size:x-small;">TraderTest : Trader</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">{</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">private</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">int</span></span><span style="color:#000000;"><span style="font-size:x-small;"> limit = 50;</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">private</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">int </span></span><span style="color:#000000;"><span style="font-size:x-small;">stockServiceResult = 40;</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">public</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">bool</span></span><span style="color:#000000;"><span style="font-size:x-small;">SellStock(</span></span><span style="color:#0000ff;"><span style="font-size:x-small;">string</span></span><span style="color:#000000;"><span style="font-size:x-small;">stockName)</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">{ </span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">     int </span></span><span style="color:#000000;"><span style="font-size:x-small;">stockValue = GetStockValue(stockName);</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">     if</span></span><span style="color:#000000;"><span style="font-size:x-small;">(stockValue &gt; limit)</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">     {</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">          return</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">true</span></span><span style="color:#000000;"><span style="font-size:x-small;">;</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">     }</span></span></p>
<p style="margin-bottom:0;"><span style="color:#0000ff;"><span style="font-size:x-small;">     return</span></span><span style="color:#000000;"><span style="font-size:x-small;"> </span></span><span style="color:#0000ff;"><span style="font-size:x-small;">false</span></span><span style="color:#000000;"><span style="font-size:x-small;">;</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">}</span></span></p>
<p style="margin-bottom:0;"> <span style="color:#000000;"><span style="font-size:x-small;"><span style="color:#0000ff;">protected override</span> <span style="color:#0000ff;">int </span>GetStockValue(<span style="color:#0000ff;">string</span>stockName)</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">{</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;"><span style="color:#0000ff;">     return </span><span style="color:#000000;">stockServiceResult</span>; </span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">}</span></span></p>
<p style="margin-bottom:0;"> </p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">[TestMethod]</span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;"><span style="color:#0000ff;">public void </span><span style="color:#000000;">SellStockTest()</span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;"><span style="color:#000000;">{</span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="color:#0000ff;"><span style="color:#000000;">     Assert.AreEqual(false,this.SellStock(“test stock”)); </span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;"><span style="color:#000000;">}</span><span style="color:#0000ff;"> </span></span></span></p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">}</span></span></p>
<p style="margin-bottom:0;"> </p>
<p style="margin-bottom:0;"><span style="color:#000000;"><span style="font-size:x-small;">The result is that we can test the SellStock method without having to call the StockService. I personally use this technique extensively when writing unit tests, and feel it&#8217;s a really good way to remove data dependencies.</span></span></p>
<p style="margin-bottom:0;"> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/torgeirhelgevold.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/torgeirhelgevold.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/torgeirhelgevold.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/torgeirhelgevold.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/torgeirhelgevold.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/torgeirhelgevold.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/torgeirhelgevold.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/torgeirhelgevold.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/torgeirhelgevold.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/torgeirhelgevold.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/torgeirhelgevold.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/torgeirhelgevold.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=5&subd=torgeirhelgevold&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://torgeirhelgevold.wordpress.com/2008/05/11/removing-data-dependency-when-writing-unit-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a51f3217677475408f784f44ae1f6a98?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">torgeirhelgevold</media:title>
		</media:content>
	</item>
		<item>
		<title>Antivirus SDKs</title>
		<link>http://torgeirhelgevold.wordpress.com/2008/05/04/antivirus-sdks/</link>
		<comments>http://torgeirhelgevold.wordpress.com/2008/05/04/antivirus-sdks/#comments</comments>
		<pubDate>Sun, 04 May 2008 03:45:47 +0000</pubDate>
		<dc:creator>torgeirhelgevold</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Antivirus SDK]]></category>
		<category><![CDATA[programmatic virus scan]]></category>
		<category><![CDATA[Torgeir Helgevold]]></category>

		<guid isPermaLink="false">http://torgeirhelgevold.wordpress.com/?p=4</guid>
		<description><![CDATA[A while ago, I was faced with the challenge of doing a programmatic virus scan from a custom application.
I decided that the best approach would be to integrate with an antivirus SDK.
After doing some research, I found two antivirus SDKs which were both available as free trial versions. The first one was made by a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=4&subd=torgeirhelgevold&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A while ago, I was faced with the challenge of doing a programmatic virus scan from a custom application.</p>
<p style="margin-bottom:0;">I decided that the best approach would be to integrate with an antivirus SDK.</p>
<p style="margin-bottom:0;">After doing some research, I found two antivirus SDKs which were both available as free trial versions. The first one was made by a company called Sophos.  Downloads and instructions for how to integrate with the product can be found at <a href="http://www.sophos.com/">www.sophos.com</a>.</p>
<p style="margin-bottom:0;">The other product I looked into was an open source alternative called Clam. The Clam engine itself is free, but I was not able to find a free integration tool for the engine. The integration tool I ended up trying is called Metadefender, which can be downloaded as a free trial version from <a href="http://www.metadefender.com/">www.metadefender.com</a>. The commercial version of Metadefender is not free, but the license is not very expensive.</p>
<p style="margin-bottom:0;">Both products were pretty easy to integrate into my application, and it seems that my application could use either one.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/torgeirhelgevold.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/torgeirhelgevold.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/torgeirhelgevold.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/torgeirhelgevold.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/torgeirhelgevold.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/torgeirhelgevold.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/torgeirhelgevold.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/torgeirhelgevold.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/torgeirhelgevold.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/torgeirhelgevold.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/torgeirhelgevold.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/torgeirhelgevold.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=torgeirhelgevold.wordpress.com&blog=3619791&post=4&subd=torgeirhelgevold&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://torgeirhelgevold.wordpress.com/2008/05/04/antivirus-sdks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a51f3217677475408f784f44ae1f6a98?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">torgeirhelgevold</media:title>
		</media:content>
	</item>
	</channel>
</rss>