Ejemplo n.º 1
0
        public void JobLoggerShouldNotModifyWriterWhenNoMessageIsLogged()
        {
            var mockWriter = new MockWriter();
            var jobLogger = new JobLogger.JobLogger(mockWriter);

            Assert.AreEqual(mockWriter.MessageLevelLog.Count, 0);
            Assert.AreEqual(mockWriter.WarningLevelLog.Count, 0);
            Assert.AreEqual(mockWriter.ErrorLevelLog.Count, 0);
        }
Ejemplo n.º 2
0
        public void LoggingOneErrorLevelMessage()
        {
            var mockWriter = new MockWriter();
            var jobLogger = new JobLogger.JobLogger(mockWriter);

            jobLogger.Error("Some message");

            Assert.AreEqual(mockWriter.MessageLevelLog.Count, 0);
            Assert.AreEqual(mockWriter.WarningLevelLog.Count, 0);
            Assert.AreEqual(mockWriter.ErrorLevelLog.Count, 1);
        }
Ejemplo n.º 3
0
        public void JobLoggerShouldNotModifyWriterWhenLoggingEmptyMessage()
        {
            var mockWriter = new MockWriter();
            var jobLogger = new JobLogger.JobLogger(mockWriter);

            jobLogger.Message(string.Empty);

            Assert.AreEqual(mockWriter.MessageLevelLog.Count, 0);
            Assert.AreEqual(mockWriter.WarningLevelLog.Count, 0);
            Assert.AreEqual(mockWriter.ErrorLevelLog.Count, 0);
        }
Ejemplo n.º 4
0
        public void LoggingMultipleMessagesWithDifferentSeverityLevels()
        {
            var mockWriter = new MockWriter();
            var jobLogger = new JobLogger.JobLogger(mockWriter);

            jobLogger.Error("Some message");
            jobLogger.Warning("Some other message");
            jobLogger.Error("Some other message");
            jobLogger.Message("Some other message");
            jobLogger.Message("Some other message");

            Assert.AreEqual(mockWriter.MessageLevelLog.Count, 2);
            Assert.AreEqual(mockWriter.WarningLevelLog.Count, 1);
            Assert.AreEqual(mockWriter.ErrorLevelLog.Count, 2);
        }