Esempio n. 1
0
        public void Test_Telemetry_LogCriticalExceptionWithObject()
        {
            // Assert
            AssertExtensions.DoesNotThrow(() =>
            {
                // Arrange
                var logger = new AppInsightsLogger("test", LogLevel.Critical);

                // Act
                logger.LogCritical(new Exception("test"), new Test
                {
                    PropA = "propA",
                    PropB = 1,
                    PropC = true,
                    PropD = new SubItem
                    {
                        PropE = "propE",
                        PropF = new List <int> {
                            1, 2, 3
                        }
                    }
                });
                logger.Flush();
            });
        }
Esempio n. 2
0
        public void Test_Telemetry_LogCriticalMessage()
        {
            // Assert
            AssertExtensions.DoesNotThrow(() =>
            {
                // Arrange
                var logger = new AppInsightsLogger("test", LogLevel.Trace);

                // Act
                logger.LogCritical("test");
                logger.Flush();
            });
        }