Exemplo n.º 1
0
 /// <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));
 }
Exemplo n.º 2
0
 public void Setup()
 {
     subscriber   = mockSubscriber.Object;
     handler      = mockHandler.Object;
     asyncHandler = mockAsyncHandler.Object;
     container    = mockContainer.Object;
 }
Exemplo n.º 3
0
 public IHandlerSetup WithTopicHandler <TTopic, THandler>(IAsyncTopicHandler <TTopic> handler) where TTopic : class
 {
     topicDispatcher.Register(handler);
     return(this);
 }