views:

1416

answers:

9

I have been looking in to doing some test driven development for one of the applications that I'm currently writing(OLE wrapper for an OLE object). The only problem is that I am using the express versions of Visual Studio(for now), at the moment I am using VB express but sometimes I use C# express.

Is it possible to do TDD in the express versions? If so what are the bast was to go about it?

Cheers.

EDIT. By the looks of things I will have to buy the full visual studio so that I can do integrated TDD, hopefully there is money in the budget to buy a copy :). For now I think I will use Nunit like everyone is saying.

+6  A: 

Nunit seems to work independently, why not try it with the express versions of Visual Studio?

It looks like you have to use the test dlls outside of VS , from the Nunit GUI.

gimel
Man NUnit doesn't work smoothly with VSExpress IMHO.
Alex Baranosky
+5  A: 

Unfortunately Jamie Cansdale, main proponent of TestDriven.NET and NUnit, ran into a lot of legal trouble when he put up TestDriven.NET that works with Visual Studio Express 2005 edition.

VS 2008 Express's EULA has been modified to lock TestDriven.NET out of the IDE.

I think the only way you can run your tests would be to explicitly open the compiled DLLs with the NUnit client outside of Visual Studio.

Jon Limjap
A: 

For unit testing you can use NUnit.

For code completion you can use NCover and NCoverExplorer.

All the above don't plug into Visual Studio Express but they do have their own UI. I normally run my tests using a batch script.

fung
+3  A: 

Microsoft won't allow 3rd party extensions for the express editions for visual studio. As Jon Limjap already mentioned Testdriven.Net won't work for visual studio. Other test-runners that integrate with visual studio like the one in resharper won't work either.

Luckilly most unit-testing frameworks like Xunit.Net, Nunit and MBUnit have their own stand-alone testrunner. You can compile your tests with visual studio express then load the test-assemblies in the testrunner and execute the tests.

You can't test code in web-projects this way. You need to put the tests and the code you want to test in separate class-libraries. Web projects are compiled on demand by the webserver and this makes testing difficult.

A useful addition by Marc Gravell: Web site projects are compiled on demand. Web application projects are pre-compiled.

So you should be able to run tests in a web-application project with an external test-runner.

Mendelt
Well, web *site* projects are compiled on demand. Web *application* projects are pre-compiled.
Marc Gravell
Thanks Marc. Will add that to my answer.
Mendelt
A: 

for tdd, there's been some development for vs express 2008, and you can find more info in this site. it's called unit express gui

melaos
+1  A: 

You might also want to consider ExpressUnit as a light weight testing framework for VS 2008 Express. The framework integrates into your solution in the form of a class library which means you don't need an external test runner to run your tests. This gives you the advantage of running your tests in-process which means you can debug your tests directly. Since VS 2008 Express is not able to attach third pary tools running out of process, this might be helpful. ExpressUnit is available as a WPF app.

Read more here http://torgeirhelgevold.wordpress.com/2008/05/31/unit-testing-in-visual-studio-express-2008/

Tor

A: 

Also tried to integrate Unit Testing into Visual Studio 2008 Express and found this site: link. Works great - and without leaving Visual Studio :)

paologios
A: 

It seems like visual C# 2010 express has some kind of extensions but I can't find anything for nunit (git or subversion). Anyone seen anything about that?

Ola
A: 

The article on ExpressUnit has moved: http://www.unit-testing.net/CurrentArticle/How-To-Write-Unit-Tests-In-Visual-Studio-Express.html