forked from ThatRendle/Simple.Data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestTraceListener.cs
More file actions
41 lines (35 loc) · 1.29 KB
/
TestTraceListener.cs
File metadata and controls
41 lines (35 loc) · 1.29 KB
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
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace Simple.Data.IntegrationTest
{
class TestTraceListener : TraceListener
{
public TestTraceListener() : base(typeof(TestTraceListener).Name)
{
}
private readonly StringBuilder _messages = new StringBuilder();
/// <summary>
/// When overridden in a derived class, writes the specified message to the listener you create in the derived class.
/// </summary>
/// <param name="message">A message to write. </param><filterpriority>2</filterpriority>
public override void Write(string message)
{
_messages.Append(message);
}
/// <summary>
/// When overridden in a derived class, writes a message to the listener you create in the derived class, followed by a line terminator.
/// </summary>
/// <param name="message">A message to write. </param><filterpriority>2</filterpriority>
public override void WriteLine(string message)
{
_messages.AppendLine(message);
}
public string Messages
{
get { return _messages.ToString(); }
}
}
}