Exemple #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));
        }
        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));
        }
Exemple #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();
        }
Exemple #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();
        }