Skip to content
Gherkin .feature files specification processor for .net
Pascal PowerShell C# JavaScript Gherkin Puppet
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Build status


Gherkin .feature files specification processor for .net

XUnitTests / NUnitTests / MsTests files are a exemplary "Spec Files" in itself.

Here is basic use case for developers writing and/or implementing unit tests:

  1. Prepare *.feature file and place it in separate "Features" directory.
  2. Add a new class with same name as your feature and place it into yet another "Specs" directory.
  3. Then, depending on your liking: a) Run your *.feature file contents through class generator: and customize it. b) Write your test class down by hand, deriving it from GherkinSpecBase and marking it with attributes, fitting all scenarios, background or steps. Test will fail as long as these descriptions wouldn't match *.feature file contents. BTW. The idea is to track *.feature file changes with failing test.
  4. Now the fun part begins... implement the steps. Your Step("") or Given("") or Whatever("") are "headers" for implementation. In between "Steps" there should be hard asserts. Whenever your code asserts, you should be able to track last step before it broke. General idea was that it should lead to longer test methods with exact progress steps.

Main point: Steps are there to match your .feature file and mark your progress through out testing Scenario.

MsTest Example

XUnit Example

NUnit Example

GherkinSpec Generator

Source for generator is here(different repo):

You can’t perform that action at this time.