Line data Source code
1 : #region Copyright
2 : // // -----------------------------------------------------------------------
3 : // // <copyright company="Chinchilla Software Limited">
4 : // // Copyright Chinchilla Software Limited. All rights reserved.
5 : // // </copyright>
6 : // // -----------------------------------------------------------------------
7 : #endregion
8 :
9 : using System;
10 : using Cqrs.Akka.Commands;
11 : using Cqrs.Commands;
12 : using Cqrs.Events;
13 :
14 : namespace Cqrs.Akka.Tests.Unit.Events.Handlers
15 : {
16 : /// <summary>
17 : /// Handles the <see cref="ConversationEnded"/>.
18 : /// </summary>
19 : public class ConversationEndedEventHandler
20 : : IEventHandler<Guid, ConversationEnded>
21 1 : {
22 : /// <summary>
23 : /// Instantiates a new instance of <see cref="ConversationEndedEventHandler"/>.
24 : /// </summary>
25 1 : public ConversationEndedEventHandler(IAkkaCommandPublisher<Guid> commandBus)
26 : {
27 : CommandBus = commandBus;
28 : }
29 :
30 : /// <summary>
31 : /// Publish any <see cref="ICommand{TAuthenticationToken}"/> instances that you want to send with this.
32 : /// </summary>
33 : protected ICommandPublisher<Guid> CommandBus { get; private set; }
34 :
35 : #region Implementation of IMessageHandler<in ConversationEnded>
36 :
37 : /// <summary>
38 : /// Responds to the provided <paramref name="message"/>.
39 : /// </summary>
40 : /// <param name="message">The <see cref="ConversationEnded"/> to respond to or "handle"</param>
41 1 : public void Handle(ConversationEnded message)
42 : {
43 : AkkaUnitTests.Step4Reached[message.CorrelationId] = true;
44 : }
45 :
46 : #endregion
47 : }
48 : }
|