Пример #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);
        }
Пример #2
0
        public void AddErrorLogTest_good_message_match()
        {
            var error = new ErrorLog("AddErrorLogTest_good_message_match");

            _logDataProxy.AddErrorLog(error);
            var logId = error.LogId;

            Assert.AreEqual(_logsOnlyForTest.GetErrorLogById(logId).msg, "AddErrorLogTest_good_message_match");
            _logsOnlyForTest.DeleteErrorLog(logId);
            _logsOnlyForTest.DeleteLog(logId);
        }