public void TestSingleLine7() { var filter = new OrFilter(new[] { new SubstringFilter("foo", false), new SubstringFilter("bar", false) }); filter.PassesFilter(new LogEntry(Core.Columns.RawContent) { RawContent = "FOOBAR" }).Should().BeFalse(); }
public void TestMultiLine2() { var filter = new OrFilter(new[] { new SubstringFilter("foo", true) }); var lines = new[] { new LogLine(0, 0, "fo", LevelFlags.All), new LogLine(0, 0, "obar", LevelFlags.All) }; filter.PassesFilter(lines).Should().BeFalse("because substring filters shouldn't be matched across lines"); }
public void TestMultiLine1() { var filter = new OrFilter(new[] { new SubstringFilter("foo", true) }); var lines = new[] { new LogLine(0, 0, "bar", LevelFlags.All), new LogLine(0, 0, "foo", LevelFlags.All) }; filter.PassesFilter(lines).Should().BeTrue("because it should be enough to have a hit on one line of a multi line entry"); }
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(); }
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(); }
public void TestMultiLine2() { var filter = new OrFilter(new[] { new SubstringFilter("foo", true) }); var lines = new[] { new LogEntry(Core.Columns.RawContent) { RawContent = "fo" }, new LogEntry(Core.Columns.RawContent) { RawContent = "obar" } }; filter.PassesFilter(lines).Should().BeFalse("because substring filters shouldn't be matched across lines"); }
public void TestMultiLine1() { var filter = new OrFilter(new[] { new SubstringFilter("foo", true) }); var lines = new[] { new LogEntry(Core.Columns.RawContent) { RawContent = "bar" }, new LogEntry(Core.Columns.RawContent) { RawContent = "foo" } }; filter.PassesFilter(lines).Should().BeTrue("because it should be enough to have a hit on one line of a multi line entry"); }
public void TestSingleLine7() { var filter = new OrFilter(new[] { new SubstringFilter("foo", false), new SubstringFilter("bar", false) }); filter.PassesFilter(new LogLine(0, 0, "FOOBAR", LevelFlags.All)).Should().BeFalse(); }