annotate Implab.Test/UnitTest1.cs @ 252:6f4630d0bcd9 v3

removed absolete Diagnostics classes
author cin
date Mon, 12 Feb 2018 07:24:31 +0300
parents 7c7e9ad6fe4a
children 34df34841225
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
249
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
1 using System;
251
7c7e9ad6fe4a Prerelease version of RunnableComponent
cin
parents: 249
diff changeset
2 using System.Diagnostics;
249
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
3 using System.Threading;
252
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
4 using Implab.Diagnostics;
249
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
5 using Xunit;
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
6
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
7 namespace Implab.Test
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
8 {
252
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
9 using static Trace<UnitTest1>;
249
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
10 public class UnitTest1
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
11 {
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
12 [Fact]
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
13 public void Test1()
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
14 {
251
7c7e9ad6fe4a Prerelease version of RunnableComponent
cin
parents: 249
diff changeset
15 var listener = new TextWriterTraceListener(Console.Out);
252
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
16 var source = TraceSource;
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
17 source.Switch.Level = SourceLevels.All;
251
7c7e9ad6fe4a Prerelease version of RunnableComponent
cin
parents: 249
diff changeset
18
7c7e9ad6fe4a Prerelease version of RunnableComponent
cin
parents: 249
diff changeset
19 source.Listeners.Add(listener);
252
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
20 Trace.Listeners.Add(listener);
251
7c7e9ad6fe4a Prerelease version of RunnableComponent
cin
parents: 249
diff changeset
21
7c7e9ad6fe4a Prerelease version of RunnableComponent
cin
parents: 249
diff changeset
22 Trace.WriteLine("Hello!");
252
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
23 StartLogicalOperation();
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
24
251
7c7e9ad6fe4a Prerelease version of RunnableComponent
cin
parents: 249
diff changeset
25 Trace.WriteLine("Inner");
7c7e9ad6fe4a Prerelease version of RunnableComponent
cin
parents: 249
diff changeset
26 foreach(var x in Trace.CorrelationManager.LogicalOperationStack)
7c7e9ad6fe4a Prerelease version of RunnableComponent
cin
parents: 249
diff changeset
27 Trace.WriteLine($"-{x}");
252
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
28 Log("source event");
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
29
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
30 listener.IndentLevel = 1;
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
31
251
7c7e9ad6fe4a Prerelease version of RunnableComponent
cin
parents: 249
diff changeset
32 source.TraceData(TraceEventType.Start, 1, DateTime.Now);
252
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
33
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
34 StopLogicalOperation();
249
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
35 }
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
36 }
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
37 }