Beispiel #1
0
        public void TestLoggerSetsSdkVersionOnLoggedTelemetry()
        {
            bool            isCorrectVersion = false;
            TelemetryClient client           = CommonMocks.MockTelemetryClient((t) =>
            {
                isCorrectVersion = t.Context.GetInternalContext().SdkVersion.StartsWith(SdkVersionUtils.VersionPrefix);
            });

            ILogger logger = new ApplicationInsightsLogger("test", client, (s, l) => { return(true); }, null);

            logger.LogTrace("This is a test.", new object[] { });
            Assert.True(isCorrectVersion);
        }
Beispiel #2
0
        public void TestUninitializedLoggerDoesNotThrowExceptions()
        {
            ILogger logger = new ApplicationInsightsLogger("test", null, null, null);

            logger.LogTrace("This won't do anything.", new object[] { });
        }