LCOV - code coverage report
Current view: top level - Cqrs.Tests/Substitutes - TestHandleRegistrar.cs Hit Total Coverage
Test: doc-coverage.info Lines: 1 4 25.0 %
Date: 2017-07-26

          Line data    Source code
       1             : using System;
       2             : using System.Collections.Generic;
       3             : using Cqrs.Bus;
       4             : using Cqrs.Messages;
       5             : 
       6             : namespace Cqrs.Tests.Substitutes
       7             : {
       8             :         public class TestHandleRegistrar : IEventHandlerRegistrar, ICommandHandlerRegistrar
       9           0 :         {
      10             :                 public static readonly IList<TestHandlerListItem> HandlerList = new List<TestHandlerListItem>();
      11             : 
      12           0 :                 public void RegisterHandler<T>(Action<T> handler, Type targetedType, bool holdMessageLock = true)
      13             :                         where T : IMessage
      14             :                 {
      15             :                         HandlerList.Add(new TestHandlerListItem {Type = typeof(T),Handler = handler});
      16             :                 }
      17             : 
      18             :                 /// <summary>
      19             :                 /// Register an event or command handler that will listen and respond to events or commands.
      20             :                 /// </summary>
      21           1 :                 public void RegisterHandler<TMessage>(Action<TMessage> handler, bool holdMessageLock = true)
      22             :                         where TMessage : IMessage
      23             :                 {
      24             :                         RegisterHandler(handler, null, holdMessageLock);
      25             :                 }
      26             :         }
      27             : 
      28             :         public class TestHandlerListItem
      29           0 :         {
      30             :                 public Type Type { get; set; }
      31             : 
      32             :                 public dynamic Handler { get; set; }
      33             :         }
      34             : }

Generated by: LCOV version 1.10