Skip to content
Leo Arnold edited this page May 22, 2017 · 3 revisions

NBehave added a couple of extension methods on top of nunit, mbunit, xunit and mstest. These will work fine alongside with your current test framework.

To use them install one of the four nuget packages

  • Install-Package nbehave.spec.nunit
  • Install-Package nbehave.spec.mbunit
  • Install-Package nbehave.spec.xunit
  • Install-Package nbehave.spec.mstest

A small example:

    using NBehave.Spec.NUnit;
    using NUnit.Framework;

    namespace Demo
    {
        public class Example
        {
            [Test]
            public void Foo()
            {
                1.ShouldEqual(1);
                2.ShouldNotEqual(1);
                var numbers = new[] {1, 2, 3};
                numbers.ShouldContain(2);
            }
        }
    }
Clone this wiki locally