NBehave v0.5 Released!


If your not running the latest builds from the build server, you might want to grab this latest stable for a few new goodies!

Some highlights include .NET 4.0 builds, more gherkin support, an improved console runner and the stable parts of the Visual Studio plugin we have been blogging about. A big thanks to John and Morgan for their hard work on this.


Happy coding!

Update: Looks like John and myself blogged at the same time, to save your RSS feed two posts we’ve merged Johns post below:

NBehave 0.5 has just been released into the wild.  The full release notes are available here, but there have been changes relating to most aspects of BDD style development:

  • Scenario processing: embedding table data into scenarios; having scenario outlines that get executed multiple times against a set of example data; comments into scenarios; language support
  • Scenario execution: run scenarios through TestDriven.Net; run scenarios from VS2010 using the NBehave plugin; support for config files
  • Scenario development: generate empty step methods using the command line
  • Documentation: more code examples are shipping with the release now
  • Unit test support: the fluent syntax is back, for those devs who want to use NBehave within a unit test framework
  • .Net 4.0 support, as well as .Net 3.5

This is quite a feature-packed release, so I will be posting more details on individual features over time.  For now though, you can grab the download from the Codeplex site.  Note that to get the VS 2010 plugin you will need to download and run the released exe file.  Enjoy!

NBehave alpha now shipping with Should assertion framework


It recently came to my attention (when dog-fooding the new version), that I wasn’t able to make any assertions!

Using NBehave without a unit testing framework means we need some other way of checking our results. So I’ve included the Should framework to complete the testing story.

I’m finding it quite a nice framework to use, and its very feature complete. I’ve ILMerged it into the main NBehave.Narrator.Framework assembly, so you don’t need to pull in any references!

Personally I prefer the Fluent API which is quite friendly to intelli-sense, and readability. Here’s an example for a test I’m writing now:

[Then("I should get the available sessions")]
public void ThenIShouldGetTheAvailableSessions()

You can grab the new version here.

NBehave VS2010 Plugin: New Builds


We’ve been hard at work improving the plug-in, and now is a good time to make it available. Please bear in mind this is still work in progress, and we really need your feedback both on stability and features.

There’s a new front-page on the bitbucket repository: http://nbehave.bitbucket.org/

New alpha builds will be published on the bitbucket download page: http://bitbucket.org/naeem.khedarun/nbehave/downloads

The wiki is also getting some love: http://bitbucket.org/naeem.khedarun/nbehave/wiki/Getting_Started

There are two new major features in the latest build:

Syntax Highlighting


Execute single scenarios


New releases will be published at @NaeemKhedarun, and major features will be blogged about here, I hope you enjoy the new features. And please, we need feedback!

Introducing the NBehave text based scenario VS2010 runner


I’ve been using NBehave for a long time now on various projects, usually using it’s fluent syntax. I wanted to move to using text based scenarios but unfortunately unless you like dropping to the command line to run your tests you were out of luck.

Now there is the wonderful looking SpecFlow, and I would be doing a disservice to the community if I didn’t mention it. It’s a very complete and increasingly popular framework for running gherkin compatible text based scenarios. However it accomplishes its task in a very different way to NBehave, and the differences are worth looking at in a separate post.

Initially John and myself took a look at making a ReSharper plug-in, however its API was driven towards running code not text and getting things working was not immediately obvious. So instead we decided on testing out the visual studio API which we had far more success with.

So let’s take a look at the new VS2010 runner and how it can make life a little easier. We will need to get the installer from the build server as the plug-in is quite new and has not made an official release yet. I would recommend getting the latest executable artefact from the following link:



Now we can run the installer and ensure the plug-in is ticked, this will deploy the VSIX package into the appropriate location.


Assuming you have a project already using text based scenarios, or have follow Johns blog post then we should be ready to go. I already have a solution ready so let’s take a look:


We can see the plug-in is loaded and ready to go, I already have a feature file and it’s associated step file set up:


If we right click on the feature file then we will find some new context menu options:


Picking Run Scenario will run the scenarios in a separate process and published the results in the output window:


The debug option does as you would expect, and both options currently run all the scenarios in the selected file. This is the first version and is quite light on features, however there are some planned:

  1. Run a single scenario.
  2. Run from solution explorer.
  3. Syntax highlighting and completion for gherkin files.
  4. Full featured results window instead of output window.
  5. Go to step definition from scenario.
  6. Keyboard shortcuts.

I hope you find it useful, if you have any suggestions or bugs you can get me on twitter at @naeemkhedarun or on CodePlex at http://nbehave.codeplex.com

Happy coding!

Older Posts