public void Should_save_all_logEntry_types()
        {
            
            LogEntry errorLog = new ErrorLogEntry("TestFramework", "Error message");
            LogEntry warningLog = new WarningLogEntry("TestFramework", "Warning message");
            LogEntry infoLog = new InfoLogEntry("TestFramework", "Information message");

            logRepo.Save(infoLog);
            logRepo.Save(warningLog);
            logRepo.Save(errorLog);

            logRepo.Get(new AllSpecification<LogEntry>())
                .Count().ShouldBe(3);

        }
Esempio n. 2
0
        public void Should_save_all_logs()
        {
            var logger = new Logger(mockPersister.Object);
            logger.VerbosityLevel = int.MaxValue;

            LogEntry infoLog = new InfoLogEntry("TestFramework", "Information message");
            LogEntry warningLog = new WarningLogEntry("TestFramework", "Warning message");
            LogEntry errorLog = new ErrorLogEntry("TestFramework", "Error message");

            logger.WriteEntry(infoLog);
            logger.WriteEntry(warningLog);
            logger.WriteEntry(errorLog);

            savedLogs.Contains(infoLog).ShouldBeTrue();
            savedLogs.Contains(warningLog).ShouldBeTrue();
            savedLogs.Contains(errorLog).ShouldBeTrue();
        }