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 System.Collections.Generic;
11 : using Cqrs.Azure.ServiceBus.Tests.Unit;
12 : using Cqrs.Messages;
13 :
14 : namespace Cqrs.Azure.ServiceBus.Tests.Integration
15 : {
16 : /// <summary>
17 : /// A Test <see cref="IMessageHandler{TMessage}"/> for handling <see cref="TestEvent"/>.
18 : /// </summary>
19 : public class TestEventSuccessHandler : IMessageHandler<TestEvent>
20 1 : {
21 : /// <summary>
22 : /// Instantiate and initialise a new <see cref="TestEventSuccessHandler"/> specifying the test flag container.
23 : /// </summary>
24 : /// <param name="testResponse">The test flag container.</param>
25 1 : public TestEventSuccessHandler(IDictionary<Guid, Tuple<bool, Exception>> testResponse)
26 : {
27 : TestResponse = testResponse;
28 : }
29 :
30 : /// <summary>
31 : /// A local reference to the test flag container.
32 : /// </summary>
33 : protected IDictionary<Guid, Tuple<bool, Exception>> TestResponse { get; private set; }
34 :
35 : #region Implementation of IHandler<in TestEvent>
36 :
37 : /// <summary>
38 : /// Sets a value into <see cref="TestResponse"/> so it can be reported back to the test class.
39 : /// </summary>
40 1 : public void Handle(TestEvent message)
41 : {
42 : TestResponse[message.Id] = new Tuple<bool, Exception>(true, null);
43 : }
44 :
45 : #endregion
46 : }
47 : }
|