/
TestRunAttachmentsProcessingEventsHandler.cs
77 lines (66 loc) · 3.17 KB
/
TestRunAttachmentsProcessingEventsHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.VisualStudio.TestPlatform.Client.TestRunAttachmentsProcessing
{
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces;
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
using System.Collections.Generic;
/// <summary>
/// The test run attachments processing events handler.
/// </summary>
///
public class TestRunAttachmentsProcessingEventsHandler : ITestRunAttachmentsProcessingEventsHandler
{
private readonly ICommunicationManager communicationManager;
/// <summary>
/// Initializes a new instance of the <see cref="TestRunAttachmentsProcessingEventsHandler"/> class.
/// </summary>
/// <param name="communicationManager"> The communication manager. </param>
public TestRunAttachmentsProcessingEventsHandler(ICommunicationManager communicationManager)
{
this.communicationManager = communicationManager;
}
/// <inheritdoc/>
public void HandleTestRunAttachmentsProcessingComplete(TestRunAttachmentsProcessingCompleteEventArgs attachmentsProcessingCompleteEventArgs, IEnumerable<AttachmentSet> lastChunk)
{
if (EqtTrace.IsInfoEnabled)
{
EqtTrace.Info("Test run attachments processing completed.");
}
var payload = new TestRunAttachmentsProcessingCompletePayload()
{
AttachmentsProcessingCompleteEventArgs = attachmentsProcessingCompleteEventArgs,
Attachments = lastChunk
};
this.communicationManager.SendMessage(MessageType.TestRunAttachmentsProcessingComplete, payload);
}
/// <inheritdoc/>
public void HandleTestRunAttachmentsProcessingProgress(TestRunAttachmentsProcessingProgressEventArgs attachmentsProcessingProgressEventArgs)
{
var payload = new TestRunAttachmentsProcessingProgressPayload()
{
AttachmentsProcessingProgressEventArgs = attachmentsProcessingProgressEventArgs,
};
this.communicationManager.SendMessage(MessageType.TestRunAttachmentsProcessingProgress, payload);
}
/// <inheritdoc/>
public void HandleProcessedAttachmentsChunk(IEnumerable<AttachmentSet> attachments)
{
throw new System.NotImplementedException();
}
/// <inheritdoc/>
public void HandleLogMessage(TestMessageLevel level, string message)
{
var testMessagePayload = new TestMessagePayload { MessageLevel = level, Message = message };
this.communicationManager.SendMessage(MessageType.TestMessage, testMessagePayload);
}
/// <inheritdoc/>
public void HandleRawMessage(string rawMessage)
{
// No-Op
}
}
}