Пример #1
0
        public void TreeMonData_SystemLogger_Insert()
        {
            LogEntry logEntry = new LogEntry()
            {
                InnerException = "IE",
                Level          = "TEST",
                LogDate        = DateTime.UtcNow,
                Source         = "SystemLoggerTests",
                Type           = "TESTINSERT",
                User           = "******"
            };

            SystemLogger sl = new SystemLogger(connectionKey);

            Assert.IsTrue(sl.Insert(logEntry));
            Assert.IsNotNull(sl.Get(logEntry.Id));
        }
Пример #2
0
        public void TreeMonData_SystemLogger_Insert_Async()
        {
            Task.Run(async() =>
            {
                LogEntry logEntry = new LogEntry()
                {
                    InnerException = "IE",
                    Level          = "TEST",
                    LogDate        = DateTime.UtcNow,
                    Source         = "SystemLoggerTests",
                    Type           = "TESTINSERT",
                    User           = "******"
                };

                SystemLogger sl = new SystemLogger(connectionKey);
                Assert.IsTrue(await sl.InsertAsync(logEntry));
                Assert.IsNotNull(sl.Get(logEntry.Id));
            }).GetAwaiter().GetResult();
        }