public void Subscribe_DomainEventSubscriber_Adds_DomainEventSubscriber() { //arrange var publisher = new DomainEventPublisher(); Action<DomainEvent> handle = domainEvent => { }; var domainEventSubscriber = new DomainEventSubscriber(handle, typeof(DomainEvent)); //act publisher.Subscribe(domainEventSubscriber); //assert }
public void Subscribe <TEvent>(Action <DomainEvent> handle) where TEvent : DomainEvent { var subscriber = new DomainEventSubscriber(handle, typeof(TEvent)); Subscribe(subscriber); }