/// <summary> /// Connects an event listener to our message bus /// </summary> /// <param name = "listener">The event listener, which will be marshalled from another AppDomain</param> /// <param name = "context">Run context event raiser</param> /// <remarks> /// We cannot pass the message bus instance to the event listener, since the listener may be in a remote AppDomain /// </remarks> private static void RegisterEventListener(IEventListener listener, IRunContextEvents context) { context.OnRunStarted += (s, e) => listener.RunStarted(); context.OnRunFinished += (s, e) => listener.RunFinished(); context.OnFeatureStarted += (s, e) => listener.FeatureStarted(e.EventInfo); context.OnFeatureFinished += (s, e) => listener.FeatureFinished(e.EventInfo); context.OnScenarioStarted += (s, e) => listener.ScenarioStarted(e.EventInfo.Title); context.OnScenarioFinished += (s, e) => listener.ScenarioFinished(e.EventInfo); }
/// <summary> /// Connects an event listener to our message bus /// </summary> /// <param name = "listener">The event listener, which will be marshalled from another AppDomain</param> /// <param name = "context">Run context event raiser</param> /// <remarks> /// We cannot pass the message bus instance to the event listener, since the listener may be in a remote AppDomain /// </remarks> private static void RegisterEventListener(IEventListener listener, IRunContextEvents context) { context.OnRunStarted += (s, e) => listener.RunStarted(); context.OnRunFinished += (s, e) => listener.RunFinished(); context.OnFeatureStarted += (s, e) => listener.FeatureStarted(e.EventInfo); context.OnFeatureFinished += (s, e) => listener.FeatureFinished(e.EventInfo); context.OnScenarioStarted += (s, e) => listener.ScenarioStarted(e.EventInfo.Title); context.OnScenarioFinished += (s, e) => listener.ScenarioFinished(e.EventInfo); }
public void SubscribeToHubEvents(IRunContextEvents context) { contextEvents = context; context.OnRunStarted += OnRunStarted; context.OnRunFinished += OnRunFinished; context.OnFeatureStarted += OnFeatureStarted; context.OnFeatureFinished += OnFeatureFinished; context.OnScenarioStarted += OnScenarioStarted; context.OnScenarioFinished += OnScenarioFinished; context.OnStepStarted += OnStepStarted; context.OnStepFinished += OnStepFinished; }
public void Init() { var catalog = new HooksCatalog(); var loader = new HooksParser(catalog); loader.FindHooks(GetType()); var handler = new HooksHandler(catalog); context = MockRepository.GenerateStub <IRunContextEvents>(); handler.SubscribeToHubEvents(context); SetupContextTags(); }
public void Init() { var catalog = new HooksCatalog(); var loader = new HooksParser(catalog); loader.FindHooks(GetType()); var handler = new HooksHandler(catalog); context = MockRepository.GenerateStub<IRunContextEvents>(); handler.SubscribeToHubEvents(context); SetupContextTags(); }