Tuesday, March 24, 2009

SharpDevelop, NUnit, and Visual Studio Express

At my software company we have access to some incredible tools and technologies. I can load up my copy of Visual Studio 2008 (Team System), publish documents to our SharePoint server, refactor code with ReSharper and then suck it into Enterprise Architect to make class diagrams. At home, however, my budget is not so grand. I'm using TortoiseSVN for Source Control, OpenOffice for more document processing needs ... and then there's the development environment.

Visual Studio Express provides most of what you will need to write applications, including a robust copy of SQL 2008 Express. The one thing it does not have is source code integration nor the testing framework. Understanding this, I set out to see what other solutions were available. I was amazed at the functionality provided by #develop, but it came with one major setback: no web support! As my "pet project" is a web application, that sort of put a damper on things ... or did it?

It turns out that I found a very workable solution that lets me develop, publish, and test my web application using a testing framework.

NUnit is an open source testing framework. You click and download it. I made the mistake of installing the binaries on Vista x64 and then had trouble launching tests. Download the source and compiling it solved that problem.

I develop my application in Visual Studio Express, which lets me do just about everything but run the tests. Of course, I can launch the NUnit GUI and test run them from there, but I like a more integrated approach.

It turns out the solution is quite simple. I created a solution that contains all of my main projects, here:

Then, I turn around and launch SharpDevelop, and create my test solution. I reference my non-web projects and test projects there:

Because NUnit is integrated right out of the box, I can simply expand my "test" menu now and hit "play" then watch the beautiful green lights ...

If there are issues, I simply double-click and I'm right there to edit the code. Subversion will pick up any changes and then it's a simple right-click to check it all back in!

Jeremy Likness

No comments:

Post a Comment