/// <summary> /// Registers a <see cref="ITopicHandler{TEvent}"/> /// </summary> /// <typeparam name="TTopic">Type of the topic message</typeparam> /// <param name="handler">Topic message handler</param> public void Register <TTopic>(IAsyncTopicHandler <TTopic> handler) { Validate <TTopic>(); handlers.Add( typeof(TTopic), eventMessage => handler.Handle((TTopic)eventMessage)); }
public void Setup() { subscriber = mockSubscriber.Object; handler = mockHandler.Object; asyncHandler = mockAsyncHandler.Object; container = mockContainer.Object; }
public IHandlerSetup WithTopicHandler <TTopic, THandler>(IAsyncTopicHandler <TTopic> handler) where TTopic : class { topicDispatcher.Register(handler); return(this); }