Example #1
0
 public void TestSubstringFilter1()
 {
     var quickFilter = new Tailviewer.BusinessLogic.Filters.QuickFilter(new QuickFilter())
         {
             Value = "foobar"
         };
     quickFilter.CreateFilter().PassesFilter(new LogLine(0, "hello foobar!", LevelFlags.None)).Should().BeTrue();
     quickFilter.CreateFilter().PassesFilter(new LogLine(0, "FOOBAR", LevelFlags.None)).Should().BeTrue();
     quickFilter.CreateFilter().PassesFilter(new LogLine(0, "FOOBA", LevelFlags.None)).Should().BeFalse();
 }
Example #2
0
 public void TestInvertFilter()
 {
     var quickFilter = new Tailviewer.BusinessLogic.Filters.QuickFilter(new QuickFilter())
         {
             Value = "foo",
             IsInverted = true
         };
     quickFilter.CreateFilter().PassesFilter(new LogLine(0, "foo", LevelFlags.None)).Should().BeFalse();
     quickFilter.CreateFilter().PassesFilter(new LogLine(0, "bar", LevelFlags.None)).Should().BeTrue();
 }
Example #3
0
        public void TestInvertFilter()
        {
            var quickFilter = new Tailviewer.BusinessLogic.Filters.QuickFilter(new QuickFilter())
            {
                Value      = "foo",
                IsInverted = true
            };

            quickFilter.CreateFilter().PassesFilter(new LogLine(0, "foo", LevelFlags.None)).Should().BeFalse();
            quickFilter.CreateFilter().PassesFilter(new LogLine(0, "bar", LevelFlags.None)).Should().BeTrue();
        }
Example #4
0
        public void TestSubstringFilter1()
        {
            var quickFilter = new Tailviewer.BusinessLogic.Filters.QuickFilter(new QuickFilter())
            {
                Value = "foobar"
            };

            quickFilter.CreateFilter().PassesFilter(new LogLine(0, "hello foobar!", LevelFlags.None)).Should().BeTrue();
            quickFilter.CreateFilter().PassesFilter(new LogLine(0, "FOOBAR", LevelFlags.None)).Should().BeTrue();
            quickFilter.CreateFilter().PassesFilter(new LogLine(0, "FOOBA", LevelFlags.None)).Should().BeFalse();
        }
 public void SetUp()
 {
     _quickFilter = new QuickFilter(new Tailviewer.Settings.QuickFilter());
     _dataSource = new SingleDataSource(_scheduler, _dataSourceSettings = new DataSource("nothing") {Id = Guid.NewGuid()});
     _model = new QuickFilterViewModel(_quickFilter, x => { })
         {
             CurrentDataSource = _dataSource
         };
     _changes = new List<string>();
     _model.PropertyChanged += (sender, args) => _changes.Add(args.PropertyName);
 }
Example #6
0
 public void TestWildcardFilter()
 {
     var quickFilter = new Tailviewer.BusinessLogic.Filters.QuickFilter(new QuickFilter())
         {
             Value = "he*rld",
             IgnoreCase = true,
             MatchType = QuickFilterMatchType.WildcardFilter
         };
     quickFilter.CreateFilter().PassesFilter(new LogLine(0, "Hello World!", LevelFlags.None)).Should().BeTrue();
     quickFilter.CreateFilter().PassesFilter(new LogLine(0, "hELlo wORld!", LevelFlags.None)).Should().BeTrue();
     quickFilter.CreateFilter().PassesFilter(new LogLine(0, "Hello Wold!", LevelFlags.None)).Should().BeFalse();
 }
Example #7
0
        public void TestWildcardFilter()
        {
            var quickFilter = new Tailviewer.BusinessLogic.Filters.QuickFilter(new QuickFilter())
            {
                Value      = "he*rld",
                IgnoreCase = true,
                MatchType  = FilterMatchType.WildcardFilter
            };

            quickFilter.CreateFilter().PassesFilter(new LogLine(0, "Hello World!", LevelFlags.None)).Should().BeTrue();
            quickFilter.CreateFilter().PassesFilter(new LogLine(0, "hELlo wORld!", LevelFlags.None)).Should().BeTrue();
            quickFilter.CreateFilter().PassesFilter(new LogLine(0, "Hello Wold!", LevelFlags.None)).Should().BeFalse();
        }
 public void SetUp()
 {
     _quickFilter = new QuickFilter(new Core.QuickFilterSettings());
     _dataSource  = new FileDataSource(_logSourceFactory, _scheduler, _dataSourceSettings = new DataSource("nothing")
     {
         Id = DataSourceId.CreateNew()
     });
     _model = new QuickFilterViewModel(_quickFilter, x => { })
     {
         CurrentDataSource = _dataSource
     };
     _changes = new List <string>();
     _model.PropertyChanged += (sender, args) => _changes.Add(args.PropertyName);
 }
Example #9
0
        public void TestInvertFilter()
        {
            var quickFilter = new Tailviewer.BusinessLogic.Filters.QuickFilter(new QuickFilterSettings())
            {
                Value      = "foo",
                IsInverted = true
            };

            quickFilter.CreateFilter().PassesFilter(new LogEntry(Columns.Minimum)
            {
                Index = 0, RawContent = "foo", LogLevel = LevelFlags.Other
            }).Should().BeFalse();
            quickFilter.CreateFilter().PassesFilter(new LogEntry(Columns.Minimum)
            {
                Index = 0, RawContent = "bar", LogLevel = LevelFlags.Other
            }).Should().BeTrue();
        }
Example #10
0
        public void TestSubstringFilter1()
        {
            var quickFilter = new Tailviewer.BusinessLogic.Filters.QuickFilter(new QuickFilterSettings())
            {
                Value = "foobar"
            };

            quickFilter.CreateFilter().PassesFilter(new LogEntry(Columns.Minimum)
            {
                Index = 0, RawContent = "hello foobar!", LogLevel = LevelFlags.Other
            }).Should().BeTrue();
            quickFilter.CreateFilter().PassesFilter(new LogEntry(Columns.Minimum)
            {
                Index = 0, RawContent = "FOOBAR", LogLevel = LevelFlags.Other
            }).Should().BeTrue();
            quickFilter.CreateFilter().PassesFilter(new LogEntry(Columns.Minimum)
            {
                Index = 0, RawContent = "FOOBA", LogLevel = LevelFlags.Other
            }).Should().BeFalse();
        }
Example #11
0
        public void TestWildcardFilter()
        {
            var quickFilter = new Tailviewer.BusinessLogic.Filters.QuickFilter(new QuickFilterSettings())
            {
                Value      = "he*rld",
                IgnoreCase = true,
                MatchType  = FilterMatchType.WildcardFilter
            };

            quickFilter.CreateFilter().PassesFilter(new LogEntry(Columns.Minimum)
            {
                Index = 0, RawContent = "Hello World!", LogLevel = LevelFlags.Other
            }).Should().BeTrue();
            quickFilter.CreateFilter().PassesFilter(new LogEntry(Columns.Minimum)
            {
                Index = 0, RawContent = "hELlo wORld!", LogLevel = LevelFlags.Other
            }).Should().BeTrue();
            quickFilter.CreateFilter().PassesFilter(new LogEntry(Columns.Minimum)
            {
                Index = 0, RawContent = "Hello Wold!", LogLevel = LevelFlags.Other
            }).Should().BeFalse();
        }