Exemplo n.º 1
0
        public void SendLogMessageTest()
        {
            LogAnalyticsWrapper logger = new LogAnalyticsWrapper(
                workspaceId: workspaceId,
                sharedKey: sharedKey);

            // after this is sent, wait a couple of minutes and then check your Log Analytics dashboard.
            // todo: if you want a true integration test, wait for it here, then query the logs from code and verify that the entries are there, then assert the test.
            logger.SendLogEntry(new TestEntity
            {
                Category     = GetCategory(),
                TestString   = $"String Test",
                TestBoolean  = true,
                TestDateTime = DateTime.UtcNow,
                TestDouble   = 2.1,
                TestGuid     = Guid.NewGuid()
            }, "demolog");
        }