Esempio n. 1
0
        public void GetNextLogIdTest_good()
        {
            var toAdd = new ErrorLog();
            var logs  = new Log
            {
                LogId       = 10,
                LogPriority = 1
            };

            toAdd.Log   = logs;
            toAdd.logId = 10;
            toAdd.msg   = "test GetNextLogIdTest_good()";
            _logDataControler.AddErrorLog(toAdd);

            var toAdd2 = new ErrorLog();
            var logs2  = new Log
            {
                LogId       = 10000,
                LogPriority = 1
            };

            toAdd2.Log   = logs2;
            toAdd2.logId = 10000;
            toAdd2.msg   = "test GetNextLogIdTest_good()";
            _logDataControler.AddErrorLog(toAdd2);
            var next = _logDataControler.GetNextLogId();

            Assert.AreEqual(next, 10001);
            _logsOnlyForTest.DeleteErrorLog(10);
            _logsOnlyForTest.DeleteLog(10);
            _logsOnlyForTest.DeleteErrorLog(10000);
            _logsOnlyForTest.DeleteLog(10000);
        }
Esempio n. 2
0
        public void AddErrorLog(Logic.Notifications_And_Logs.ErrorLog error)
        {
            try
            {
                var errorlog = new Database.LinqToSql.ErrorLog();
                errorlog = ConvertErrorLog(error);

                _logDataControler.AddErrorLog(errorlog);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return;
            }
        }