##// END OF EJS Templates
Implab.Diagnostics drafts
Implab.Diagnostics drafts

File last commit:

r253:34df34841225 v3.0.1-beta v3
r253:34df34841225 v3.0.1-beta v3
Show More
UnitTest1.cs
29 lines | 796 B | text/x-csharp | CSharpLexer
using System;
using System.Diagnostics;
using System.Threading;
using Implab.Diagnostics;
using Xunit;
namespace Implab.Test {
using System.Threading.Tasks;
using static Trace<UnitTest1>;
public class UnitTest1 {
[Fact]
public async Task Test1() {
var listener = new SimpleTraceListener(Console.Out);
var source = TraceSource;
source.Switch.Level = SourceLevels.All;
source.Listeners.Add(listener);
using (var op = LogicalOperation(nameof(Test1)))
using (LogicalOperation("InnerOperation")){
await Task.Yield();
Log("Inner");
await Task.Yield();
Log("source event");
}
}
}
}