Skip to content

StorEvil Context Classes

davidmfoley edited this page Sep 13, 2010 · 12 revisions

StorEvil instantiates classes that you create (Context Classes) in order to interpret specifications.
These Context classes are similar to Steps in Cucumber.

Your context classes must follow a few rules:

  1. Must be public and have the StoreEvil.Context attribute
  2. You must tell StorEvil the assemblies that contain your context classes using the storevil.config or a command-line switch.

for example:


[StorEvil.Context]
public class ExampleContext  {
    public void Given_some_precondition() {
    }
}

Note that the types of any return values of context method for partial matches do not necessarily need to be public:


[StorEvil.Context]
public class ExampleContext  {
    public ExampleSubContext Given_some_precondition() {
        return new ExampleSubContext();
    }
}

internal class ExampleSubContext {
   ...
}
Clone this wiki locally