我用 NBehave 写了很多故事。
现在我已经看到了输出以人类容易理解的格式显示的示例 (查看此示例)Wayback machine link
有没有办法在 resharper 中获取此输出?
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?
此 发布者Jörg Jenni 在他的博客上。 他展示了如何显示 nBehave 输出:
使用最新版本的 NBehave 0.4 时,您可能会注意到 不再有输出写入 ReSharper Testrunner 输出。 这是我解决该问题的方法。 我从以下来源获得了规格 下课后一切都恢复正常了: 公共类 SpecBaseWithConsoleOutput:SpecBase { 私有EventHandler> 添加了处理程序; 私有EventHandler> 场景创建处理程序; 私有EventHandler> 故事创建处理程序; 公共重写 void MainSetup() { 基.MainSetup(); 添加处理程序 = (o, a) => Console.WriteLine(a.EventData.Message); sceneCreatedHandler = (o, a) =>; Console.WriteLine(a.EventData.Title); StoryCreatedHandler = (o, a) =>; Console.WriteLine(a.EventData.Title); Story.MessageAdded += addedHandler; Story.ScenarioCreated += sceneCreatedHandler; Story.StoryCreated += StoryCreatedHandler; } 公共重写 void MainTeardown() { Story.MessageAdded -= addHandler; Story.ScenarioCreated -= sceneCreatedHandler; Story.StoryCreated -=storyCreatedHandler; 基.MainTeardown(); } }
使用最新版本的 NBehave 0.4 时,您可能会注意到 不再有输出写入 ReSharper Testrunner 输出。
这是我解决该问题的方法。 我从以下来源获得了规格 下课后一切都恢复正常了:
公共类 SpecBaseWithConsoleOutput:SpecBase { 私有EventHandler> 添加了处理程序; 私有EventHandler> 场景创建处理程序; 私有EventHandler> 故事创建处理程序; 公共重写 void MainSetup() { 基.MainSetup(); 添加处理程序 = (o, a) => Console.WriteLine(a.EventData.Message); sceneCreatedHandler = (o, a) =>; Console.WriteLine(a.EventData.Title); StoryCreatedHandler = (o, a) =>; Console.WriteLine(a.EventData.Title); Story.MessageAdded += addedHandler; Story.ScenarioCreated += sceneCreatedHandler; Story.StoryCreated += StoryCreatedHandler; } 公共重写 void MainTeardown() { Story.MessageAdded -= addHandler; Story.ScenarioCreated -= sceneCreatedHandler; Story.StoryCreated -=storyCreatedHandler; 基.MainTeardown(); } }
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(); } }
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(); } }
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
此 发布者Jörg Jenni 在他的博客上。 他展示了如何显示 nBehave 输出:
This was posted by Jörg Jenni on his blog. He shows how to get nBehave output to display: