##// END OF EJS Templates
Merge pull request !2 from ImplabNet v3...
Merge pull request !2 from ImplabNet v3 Changes from branch: V3

File last commit:

r289:95896f882995 v3.0.14 v3
r294:abef3ebaa230 merge default
Show More
DiagnosticsTest.cs
33 lines | 768 B | text/x-csharp | CSharpLexer
using System;
using System.Threading;
using System.Threading.Tasks;
using Implab.Components;
using Implab.Diagnostics;
using Xunit;
namespace Implab.Test {
public class DiagnosticsTest {
class Foo {}
[Fact]
public void TestRegistration() {
var channel = TraceSourceChannel<Foo>.Default;
Assert.Equal(typeof(Foo), channel.Id);
Assert.Equal(typeof(Foo).FullName, channel.Source.Name);
TraceSourceChannel found = null;
int visited = 0;
TraceRegistry.Global.Subscribe(x => {
visited++;
found = x as TraceSourceChannel;
});
Assert.Equal(1,visited);
Assert.Equal(channel, found);
}
}
}