Line data Source code
1 : using System;
2 : using Cqrs.Akka.Commands;
3 : using Cqrs.Akka.Tests.Unit.Commands;
4 : using Cqrs.Commands;
5 : using Cqrs.Events;
6 :
7 : namespace Cqrs.Akka.Tests.Unit.Events.Handlers
8 : {
9 : public class HelloWorldSaidEventHandler
10 : : IEventHandler<Guid, HelloWorldSaid>
11 0 : {
12 0 : public HelloWorldSaidEventHandler(IAkkaCommandSender<Guid> commandBus)
13 : {
14 : CommandBus = commandBus;
15 : }
16 :
17 : protected ICommandPublisher<Guid> CommandBus { get; private set; }
18 :
19 : #region Implementation of IMessageHandler<in HelloWorldSaid>
20 :
21 0 : public void Handle(HelloWorldSaid message)
22 : {
23 : CommandBus.Publish(new ReplyToHelloWorldCommand {Id = message.Id});
24 : AkkaUnitTests.Step1Reached[message.CorrelationId] = true;
25 : }
26 :
27 : #endregion
28 : }
29 : }
|