1

I wrote a bunch of stories using NBehave.

Now I have seen examples where the output is display in human readily format (see this example)Wayback machine link

Is there any way to get this output in resharper?

rene
  • 41,474
  • 78
  • 114
  • 152
RandomProgrammer
  • 1,570
  • 1
  • 14
  • 23
  • Notice that the link is dead. The project is now on github: https://github.com/nbehave/NBehave/wiki/Getting%20Started – rene Jul 19 '15 at 18:35

1 Answers1

2

This was posted by Jörg Jenni on his blog. He shows how to get nBehave output to display:

When working with the latest build of NBehave 0.4 you may notice that there is no output written to the ReSharper Testrunner Output anymore.

Here is how I did workaround the problem. I derived the specs from the following class and every thing was fine again:

public class SpecBaseWithConsoleOutput: SpecBase
{
  private EventHandler<EventArgs<MessageEventData>> addedHandler;
  private EventHandler<EventArgs<Scenario>> scenarioCreatedHandler;   
  private EventHandler<EventArgs<Story>> storyCreatedHandler;
  public override void MainSetup()
  {
    base.MainSetup();
    addedHandler = (o, a) => Console.WriteLine(a.EventData.Message);
    scenarioCreatedHandler = (o, a) => Console.WriteLine(a.EventData.Title);
    storyCreatedHandler = (o, a) => Console.WriteLine(a.EventData.Title);
    Story.MessageAdded += addedHandler;
    Story.ScenarioCreated += scenarioCreatedHandler;
    Story.StoryCreated += storyCreatedHandler;
  }
  public override void MainTeardown()
  {
    Story.MessageAdded -= addedHandler;
    Story.ScenarioCreated -= scenarioCreatedHandler;
    Story.StoryCreated -= storyCreatedHandler;
    base.MainTeardown();
  }
}
BSMP
  • 4,596
  • 8
  • 33
  • 44
Thedric Walker
  • 1,817
  • 15
  • 23