view 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
line wrap: on
line source

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");
            }
        }
    }
}