public void Enable_Disable() { var tracer = new TestTracer(); Assert.False(tracer.IsEnabled("TestEvent")); tracer.Enable("TestEvent"); Assert.True(tracer.IsEnabled("TestEvent")); tracer.Disable("TestEvent"); Assert.False(tracer.IsEnabled("TestEvent")); }
public void Ctor_SpecifySubscriptions() { var tracer = new TestTracer(new string[] { DiagnosticEventKeys.RequestStart, DiagnosticEventKeys.RequestSuccess }); Assert.True(tracer.IsEnabled(DiagnosticEventKeys.RequestStart)); Assert.True(tracer.IsEnabled(DiagnosticEventKeys.RequestSuccess)); // Others shouldn't be enabled. Assert.False(tracer.IsEnabled(DiagnosticEventKeys.RequestFailure)); Assert.False(tracer.IsEnabled(DiagnosticEventKeys.MiddlewareFailure)); }
public void EnableAll_SubscribesToAllEvents(string key) { var tracer = new TestTracer(); tracer.EnableAll(); Assert.True(tracer.IsEnabled(key)); }
public void Ctor_DefaultSubscribesToAllEvents(string key) { var tracer = new TestTracer(); Assert.True(tracer.IsEnabled(key)); }
public void IsEnabled_NotSubscribedByDefault(string key) { var tracer = new TestTracer(); Assert.False(tracer.IsEnabled(key)); }