public async Task ShouldSubscribeToAndPublishAnEvent()
        {
            var bus        = new ComponentBus();
            var publisher  = new PublishingComponent(bus);
            var subscriber = new SubscribingComponent(bus);

            await publisher.PublishEvent();

            Assert.Equal(1, subscriber.Count);
        }
 public SubscribingComponent(ComponentBus bus)
 {
     bus.Subscribe <TestEventMessage>(ReceiveMessage);
 }
 public GenericSubscribingComponent(ComponentBus bus)
 {
     bus.Subscribe <TestEventMessage>((sender, e) => ReceiveMessage(e));
 }
 public PublishingComponent(ComponentBus bus)
 {
     _bus = bus;
 }
 public SubscribingComponent(ComponentBus bus)
 {
     bus.Subscribe(typeof(TestEventMessage), (sender, e) => ReceiveMessage(e));
 }