BDD with Visual Studio 2005

70 views Asked by At

I'm trying to bring some BDD practices into my workplace (I use JBehave at home) but sadly they use Visual Studio 2005 and aren't planning on changing anytime soon. Unfortunately, all the BDD tools I've found such as nSpec and nBehave all seem to need .net 3.5 or higher, which VS2005 cannot easily accommodate.

How could one practice a BDD style with automated acceptance tests in a VS2005 environment? Is it even reasonably plausible?

1

There are 1 answers

0
Lunivore On

You can knock up a little custom DSL like this one. You lose the benefits of complete readability, but you can still have - and capture - all the same conversations, which is where the real benefit of BDD lies.

For these scenarios, I just divided the various steps up into different contexts, then returned them from a base class using GivenTheContext, or When or Then as appropriate. If you download the source and have a look I think it will make sense.

Of course, you won't have access to the automation tools, but that's a different problem to the framework you use for the actual scenarios themselves. If necessary you can run the scenarios through the controller layer and check the GUI manually.

This is based on a technique I've used successfully in VS2008 and VS2010 in two different Enterprise projects. I see no reason why it shouldn't work for VS2005.