Minor bug fix/suggestion

Jul 1, 2009 at 4:39 AM
Edited Jul 1, 2009 at 4:45 AM

First off great work!

I recently downloaded nbehave to test in a MSTest project. I had a few minor issues but nothing serious.

I didn't have time to look into joining as a contributor to source, or read on what your change policies were like. 

As a quick and dirty hack, I added this method to the StoryResults class:

public bool Contains(ScenarioResults result){ return  _scenarioResults.Contains(result);}

This enabled me to check for existence in the for loop inside CompileResults method of Story. This fixes the minor summary output issue in the current release.


(results.Contains(result)) continue;

I have temporarily extended this code base to be MSTest specific so that we can run without TestDriven.net and still use the built in testing commands for common functions.

I swapped out the attributes for MSTest attributes, and added the following check to call TestInitialize in the StoryRunner class.

 if (themeClass is SpecBase){ ((SpecBase)themeClass).MainSetup(); }

I also copied the FileOutputListener and created a ConsoleOutputListener to write the same results to the output window.

In less than 30 minutes I was able to get it to work with our existing test template format.

The readable format of this approach has our PM very excited. I sincerely hope you keep up this great work!

I am interested in other people's experiences especially around using this within VS and MSTest.

Jul 1, 2009 at 9:31 PM

Dont go looking for any change policies, I have never seen any :)

Could you please package this as an svn-patch? It  would make it easier to check out and eventually apply.