IT:AD:SpecFlow:HowTo:Define Hooks
Summary
Process
- [BeforeTestRun]
- [AfterTestRun]
- [BeforeFeature]
- [AfterFeature]
- [BeforeScenario]
- [AfterScenario]
- [BeforeScenarioBlock]
- [AfterScenarioBlock]
- [BeforeStep]
- [AfterStep]
Note:
t
he above Hooks have to be applied to static methods or the unit tests will fail.
Example
[Binding]
public class StudentSearchServiceSteps
{
//IMPORTANT: Notice that method is *static*....
[BeforeTestRun]
public static void Init()
{
MOE.NSI.POC.Application.AppBootstrapper.Initialize();
}
...
}
## Resources ##