Example #1
0
        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());
        }
Example #2
0
        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());
        }
Example #3
0
        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());
        }