示例#1
0
        public void OrFilter_Constructor()
        {
            var filter = new OrFilter(new CategoryFilter("Dummy"), new CategoryFilter("Another"));

            Assert.False(filter.IsEmpty);
            Assert.That(filter.Match(dummyFixture));
            Assert.That(filter.Match(anotherFixture));
        }
示例#2
0
        public void TestNestedOrNotFilters()
        {
            var filter = new OrFilter(
                new CategoryFilter("Dummy"),
                new NotFilter(new CategoryFilter("Dummy")));

            Assert.That(filter.Match(_dummyFixture));
            Assert.That(filter.IsExplicitMatch(_dummyFixture));

            Assert.That(filter.Match(_anotherFixture));
            Assert.False(filter.IsExplicitMatch(_anotherFixture));

            Assert.That(filter.Match(_yetAnotherFixture));
            Assert.False(filter.IsExplicitMatch(_yetAnotherFixture));

            Assert.That(filter.Match(_explicitFixture));
            Assert.False(filter.IsExplicitMatch(_explicitFixture));
        }
示例#3
0
        public void TestSingleLine3()
        {
            var filter = new OrFilter(new[] { new SubstringFilter("foo", true) });
            var line   = new LogLine(0, 0, "bar", LevelFlags.All);

            filter.PassesFilter(line).Should().BeFalse();
            var matches = filter.Match(line);

            matches.Should().NotBeNull();
            matches.Should().BeEmpty();
        }
示例#4
0
        public void TestSingleLine3()
        {
            var filter = new OrFilter(new[] { new SubstringFilter("foo", true) });
            var line   = new LogEntry(Core.Columns.RawContent)
            {
                RawContent = "bar"
            };

            filter.PassesFilter(line).Should().BeFalse();
            var matches = filter.Match(line);

            matches.Should().NotBeNull();
            matches.Should().BeEmpty();
        }