Skip to content
MorganPersson edited this page Nov 26, 2012 · 1 revision

If you cant use the R# or Visual Studio plugin the EmbeddedRunner is an option you can use. You simply "embed" it in another testing frameowrk, for example nunit.

Feature in the test

using NBehave.Narrator.Framework;
using NUnit.Framework;

namespace EmbeddedRunner.Example
{
    [TestFixture]
    public class EmbeddedRunnerSpec
    {
        [Test]
        public void Should_write_Feature()
        {
            @"
            Feature: x
                narrative
            Scenario: y
                Given a
                When b
                Then c"
            .ExecuteText();
        }
    }
}

Feature in file

using NBehave.Narrator.Framework;
using NUnit.Framework;

namespace EmbeddedRunner.Example
{
    [TestFixture]
    public class EmbeddedRunnerSpec
    {
        [Test]
        public void Should_write_Feature()
        {
            @"xyz.feature".ExecuteFile();
        }
    }
}
Clone this wiki locally