コード例 #1
0
        public void accept_entries_that_got_an_exception()
        {
            var sut = new ExceptionsOnly();
            var entry = new LogEntry(LogLevel.Trace, "kkjlsdfkl", new Exception());

            var actual = sut.IsSatisfiedBy(entry);

            Assert.AreEqual(actual, true);
        }
コード例 #2
0
        public void reject_entry_without_exception()
        {
            var sut = new ExceptionsOnly();
            var entry = new LogEntry(LogLevel.Trace, "kkjlsdfkl", null);

            var actual = sut.IsSatisfiedBy(entry);

            Assert.AreEqual(actual, false);
        }
コード例 #3
0
        public void higher_level_is_inclusive()
        {
            var sut = new LogLevelFilter();
            sut.MaxLevel = LogLevel.Warning;
            var entry = new LogEntry(LogLevel.Warning, "kksdl", null);

            var actual = sut.IsSatisfiedBy(entry);

            Assert.AreEqual(actual, true);
        }
コード例 #4
0
        public void higher_level_rejects_those_above()
        {
            var sut = new LogLevelFilter();
            sut.MaxLevel = LogLevel.Info;
            var entry = new LogEntry(LogLevel.Warning, "kksdl", null);

            var actual = sut.IsSatisfiedBy(entry);

            Assert.AreEqual(actual, false);
        }
コード例 #5
0
        public void lower_level_is_accepting_above_ones()
        {
            var sut = new LogLevelFilter();
            sut.MinLevel = LogLevel.Info;
            var entry = new LogEntry(LogLevel.Warning, "kksdl", null);

            var actual = sut.IsSatisfiedBy(entry);

            Assert.AreEqual(actual, true);
        }
コード例 #6
0
        public void lower_level_rejects_those_under()
        {
            var sut = new LogLevelFilter();
            sut.MinLevel = LogLevel.Warning;
            var entry = new LogEntry(LogLevel.Info, "kksdl", null);

            var actual = sut.IsSatisfiedBy(entry);

            Assert.AreEqual(actual, false);
        }
コード例 #7
0
 public override void Write(LogEntry entry)
 {
     Entries.Add(entry);
 }
コード例 #8
0
        public void higher_level_is_accepting_below_ones()
        {
            var sut = new LogLevelFilter();
            sut.MaxLevel = LogLevel.Info;
            var entry = new LogEntry(LogLevel.Debug, "kksdl", null);

            var actual = sut.IsSatisfiedBy(entry);

            Assert.AreEqual(actual, true);
        }