public int VerifyLogExceptionResident() { var mockChannel = new MockTelemetryChannel(); var config = new TelemetryConfiguration { TelemetryChannel = mockChannel, InstrumentationKey = Guid.NewGuid().ToString(), }; var client = new TelemetryClient(config); var logger = new TelemetryLogger { Client = client }; logger.LogException(new Exception("exception")); return(mockChannel.SentExceptions.Count()); }
public int VerifyLogEntryWithSeverityInformationResident() { var mockChannel = new MockTelemetryChannel(); var config = new TelemetryConfiguration { TelemetryChannel = mockChannel, InstrumentationKey = Guid.NewGuid().ToString(), }; var client = new TelemetryClient(config); var logger = new TelemetryLogger { Client = client }; logger.Entry("message", Severity.Information); return(mockChannel.SentTraces.Count()); }
public int VerifyLogEventResident() { var mockChannel = new MockTelemetryChannel(); var config = new TelemetryConfiguration { TelemetryChannel = mockChannel, InstrumentationKey = Guid.NewGuid().ToString(), }; var client = new TelemetryClient(config); var logger = new TelemetryLogger { Client = client }; logger.LogEvent(Event.Command, "parameters"); return(mockChannel.SentEvents.Count()); }