This project is read-only.

Story output in xUnit + R#

Mar 25, 2009 at 6:45 PM

am using xUnit 1.1 as out unit test framework with NBehave and ReSharper as our test runner.

How does one get the story output sent to Console (standard output) so xUnit captures it and thus displayed in R# unit test session window?

Many thanks,

- Damian
Mar 29, 2009 at 10:11 PM
Are you using the story framewok with Given/When/Then or are you "only" using the spec framework part?
Please post a short example of your code.
Mar 31, 2009 at 1:06 PM
Sorry, I should have given more detail than that, I know better ;)

Am using the story and the spec framework part. My spec class are inheriting from NBehave.Spec.Xunit.SpecBase<TContext>

I see you've updated the SVN repository with XUnit 1.1, I'll test against that and I'll extract out a sample piece of code later this evening.
Apr 5, 2009 at 8:57 AM
At least I never thought of using that combination, the  SpecBase parts are not connected to the story part of the framework.
But, you can easily get the story output anyway, just add the following line of code
Story.MessageAdded += (sender, e) => Console.WriteLine(e.EventData.Message);
And viola, you can run Stories with ReSharper and get story output :)