Skip to content

AI Chat

How can I log a message every time one of my scenarios has finished?

Create a SceneWatcher for the scenario and subscribe to its After event, which every scenario fires once it has finished. Register the watcher in the Director and it will be called for every run of that scenario.

public class CalculateWatcher : ISceneWatcher<Calculate>
{
public void Watch(Calculate scenario)
{
scenario.After += (sender, args) => Console.WriteLine("Calculate ended");
}
}