public void TraceListenerFlushesChannel() { TelemetryConfiguration.Active.TelemetryChannel = this.adapterHelper.Channel; using (var listener = new ApplicationInsightsTraceListener(Guid.NewGuid().ToString())) { try { listener.Flush(); Assert.Fail(); } catch (Exception ex) { Assert.AreEqual("Flush called", ex.Message); } } }
public void TraceListenerFlushesChannel() { #pragma warning disable CS0618 // Type or member is obsolete TelemetryConfiguration.Active.TelemetryChannel = this.adapterHelper.Channel; #pragma warning restore CS0618 // Type or member is obsolete using (var listener = new ApplicationInsightsTraceListener(Guid.NewGuid().ToString())) { try { listener.Flush(); Assert.Fail(); } catch (Exception ex) { Assert.AreEqual("Flush called", ex.Message); } } }