annotate Implab.Test/UnitTest1.cs @ 254:12c00235b105 v3

Добавлена метка v3.0.1-beta для набора изменений 34df34841225
author cin
date Mon, 12 Feb 2018 17:03:49 +0300
parents 34df34841225
children c52691faaf21
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
253
34df34841225 Implab.Diagnostics drafts
cin
parents: 252
diff changeset
7 namespace Implab.Test {
34df34841225 Implab.Diagnostics drafts
cin
parents: 252
diff changeset
8 using System.Threading.Tasks;
252
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
9 using static Trace<UnitTest1>;
253
34df34841225 Implab.Diagnostics drafts
cin
parents: 252
diff changeset
10 public class UnitTest1 {
249
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
11 [Fact]
253
34df34841225 Implab.Diagnostics drafts
cin
parents: 252
diff changeset
12 public async Task Test1() {
34df34841225 Implab.Diagnostics drafts
cin
parents: 252
diff changeset
13 var listener = new SimpleTraceListener(Console.Out);
34df34841225 Implab.Diagnostics drafts
cin
parents: 252
diff changeset
14
252
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
15 var source = TraceSource;
6f4630d0bcd9 removed absolete Diagnostics classes
cin
parents: 251
diff changeset
16 source.Switch.Level = SourceLevels.All;
251
7c7e9ad6fe4a Prerelease version of RunnableComponent
cin
parents: 249
diff changeset
17
7c7e9ad6fe4a Prerelease version of RunnableComponent
cin
parents: 249
diff changeset
18 source.Listeners.Add(listener);
7c7e9ad6fe4a Prerelease version of RunnableComponent
cin
parents: 249
diff changeset
19
253
34df34841225 Implab.Diagnostics drafts
cin
parents: 252
diff changeset
20 using (var op = LogicalOperation(nameof(Test1)))
34df34841225 Implab.Diagnostics drafts
cin
parents: 252
diff changeset
21 using (LogicalOperation("InnerOperation")){
34df34841225 Implab.Diagnostics drafts
cin
parents: 252
diff changeset
22 await Task.Yield();
34df34841225 Implab.Diagnostics drafts
cin
parents: 252
diff changeset
23 Log("Inner");
34df34841225 Implab.Diagnostics drafts
cin
parents: 252
diff changeset
24 await Task.Yield();
34df34841225 Implab.Diagnostics drafts
cin
parents: 252
diff changeset
25 Log("source event");
34df34841225 Implab.Diagnostics drafts
cin
parents: 252
diff changeset
26 }
249
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
27 }
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
28 }
d82909310094 Implab.Test moved to xunit
cin
parents:
diff changeset
29 }