UnitTest1.cs
37 lines
| 977 B
| text/x-csharp
|
CSharpLexer
/ Implab.Test / UnitTest1.cs
cin
|
r249 | using System; | ||
cin
|
r251 | using System.Diagnostics; | ||
cin
|
r249 | using System.Threading; | ||
cin
|
r252 | using Implab.Diagnostics; | ||
cin
|
r249 | using Xunit; | ||
namespace Implab.Test | ||||
{ | ||||
cin
|
r252 | using static Trace<UnitTest1>; | ||
cin
|
r249 | public class UnitTest1 | ||
{ | ||||
[Fact] | ||||
public void Test1() | ||||
{ | ||||
cin
|
r251 | var listener = new TextWriterTraceListener(Console.Out); | ||
cin
|
r252 | var source = TraceSource; | ||
source.Switch.Level = SourceLevels.All; | ||||
cin
|
r251 | |||
source.Listeners.Add(listener); | ||||
cin
|
r252 | Trace.Listeners.Add(listener); | ||
cin
|
r251 | |||
Trace.WriteLine("Hello!"); | ||||
cin
|
r252 | StartLogicalOperation(); | ||
cin
|
r251 | Trace.WriteLine("Inner"); | ||
foreach(var x in Trace.CorrelationManager.LogicalOperationStack) | ||||
Trace.WriteLine($"-{x}"); | ||||
cin
|
r252 | Log("source event"); | ||
listener.IndentLevel = 1; | ||||
cin
|
r251 | source.TraceData(TraceEventType.Start, 1, DateTime.Now); | ||
cin
|
r252 | |||
StopLogicalOperation(); | ||||
cin
|
r249 | } | ||
} | ||||
} | ||||