main
cs 56 lines 1.56 KB
Raw
1 // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3 namespace WixToolsetTest.Converters.Mocks
4 {
5 using System;
6 using System.Collections.Generic;
7 using WixToolset.Data;
8 using WixToolset.Extensibility;
9 using WixToolset.Extensibility.Services;
10
11 public class MockMessaging : IMessaging
12 {
13 public List<Message> Messages { get; } = new List<Message>();
14
15 public bool EncounteredError => this.ErrorCount > 0;
16
17 public int ErrorCount { get; private set; }
18
19 public int LastErrorNumber { get; }
20
21 public bool ShowVerboseMessages { get; set; }
22
23 public bool SuppressAllWarnings { get; set; }
24
25 public bool WarningsAsError { get; set; }
26
27 public void ElevateWarningMessage(int warningNumber)
28 {
29 throw new NotImplementedException();
30 }
31
32 public void SetListener(IMessageListener listener)
33 {
34 throw new NotImplementedException();
35 }
36
37 public void SuppressWarningMessage(int warningNumber)
38 {
39 throw new NotImplementedException();
40 }
41
42 public void Write(Message message)
43 {
44 this.Messages.Add(message);
45 if (message.Level == MessageLevel.Error)
46 {
47 ++this.ErrorCount;
48 }
49 }
50
51 public void Write(string message, bool verbose = false)
52 {
53 throw new NotImplementedException();
54 }
55 }
56 }