Esempio n. 1
0
        public void TestCtor()
        {
            var quickFilter = new QuickFilterSettings();

            quickFilter.Id.Should().NotBe(QuickFilterId.Empty);
            quickFilter.Value.Should().BeNullOrEmpty();
            quickFilter.IgnoreCase.Should().BeTrue();
            quickFilter.IsInverted.Should().BeFalse();
        }
Esempio n. 2
0
        public void TestClone()
        {
            var filter = new QuickFilterSettings
            {
                IgnoreCase = true,
                IsInverted = true,
                MatchType  = FilterMatchType.TimeFilter,
                Value      = "hello"
            };
            var clone = filter.Clone();

            clone.Should().NotBeNull();
            clone.Should().NotBeSameAs(filter);
            clone.IgnoreCase.Should().BeTrue();
            clone.IsInverted.Should().BeTrue();
            clone.MatchType.Should().Be(FilterMatchType.TimeFilter);
            clone.Value.Should().Be("hello");
        }
Esempio n. 3
0
        public void TestRoundtrip([Values(true, false)] bool ignoreCase,
                                  [Values(true, false)] bool isInverted,
                                  [Values(FilterMatchType.RegexpFilter, FilterMatchType.SubstringFilter, FilterMatchType.WildcardFilter)] FilterMatchType matchType,
                                  [Values("", "foo", "bar")] string value)
        {
            var id     = QuickFilterId.CreateNew();
            var config = new QuickFilterSettings
            {
                Id         = id,
                IgnoreCase = ignoreCase,
                IsInverted = isInverted,
                MatchType  = matchType,
                Value      = value
            };

            var actualQuickFilter = Roundtrip(config);

            actualQuickFilter.Should().NotBeNull();
            actualQuickFilter.Id.Should().Be(id);
            actualQuickFilter.IgnoreCase.Should().Be(ignoreCase);
            actualQuickFilter.IsInverted.Should().Be(isInverted);
            actualQuickFilter.MatchType.Should().Be(matchType);
            actualQuickFilter.Value.Should().Be(value);
        }
Esempio n. 4
0
 private QuickFilterSettings Roundtrip(QuickFilterSettings quickFilter)
 {
     return(quickFilter.Roundtrip(typeof(QuickFilterId)));
 }