2017 October Release

Defining a ScenarioPermanent link for this heading

Often different unit tests use the same basic setup. To ensure consistent tests, the init and cleanup code for these tests can be factored out into a so called scenario.

A scenario consists of some global variables, a expression to initialize the scenario and an optiona cleanup expression.

A unit test can use a scenario to define the setting.

Example

scenario SCOneUser {
  User theuser;

  expression {

    theuser = #User.ObjectCreate();

  }

  cleanup = expression {

     theuser.ObjectDelete();

  }

}

test UTWithUser using SCOneUser {

  expression {

    string subject = theuser.objsubject;

  }

}