Exemplo n.º 1
0
        public void Create_ForSpecificEnumType()
        {
            filters.Register(typeof(TestEnum), "equals", typeof(StringEqualsFilter));

            IGridFilter?actual = filters.Create(typeof(TestEnum), "EQUALS", Array.Empty <String>());

            Assert.Equal("equals", Assert.IsType <StringEqualsFilter>(actual).Method);
        }
Exemplo n.º 2
0
        public void Create_ForSpecificEnumType(Type type)
        {
            filters.Register(type, "equals", typeof(StringFilter));

            IGridFilter?actual = filters.Create(type, "EQUALS", "");

            Assert.Equal("equals", Assert.IsType <StringFilter>(actual).Method);
        }
Exemplo n.º 3
0
        public void First_Get_Caches()
        {
            filter.Column.Grid.Query = HttpUtility.ParseQueryString("name-contains=a");

            IGridFilter?expected = filter.First;

            filter.Column.Grid.Query = HttpUtility.ParseQueryString("name-equals=b");

            IGridFilter actual = filter.First !;

            Assert.IsType <StringContainsFilter>(actual);
            Assert.Equal("a", actual.Values.Single());
            Assert.Equal("contains", actual.Method);
            Assert.Same(expected, actual);
        }
Exemplo n.º 4
0
        public void Second_Get_Caches()
        {
            filter.Type = GridFilterType.Double;
            filter.Column.Grid.Query = HttpUtility.ParseQueryString("name-contains=a&name-equals=b");

            IGridFilter?expected = filter.Second;

            filter.Column.Grid.Query = HttpUtility.ParseQueryString("name-starts-with=d&name-ends-with=e");

            IGridFilter actual = filter.Second !;

            Assert.IsType <StringEqualsFilter>(actual);
            Assert.Equal("b", actual.Values.Single());
            Assert.Equal("equals", actual.Method);
            Assert.Same(expected, actual);
        }
Exemplo n.º 5
0
        public void Create_ForType()
        {
            IGridFilter?actual = filters.Create(typeof(String), "CONTAINS", Array.Empty <String>());

            Assert.Equal("contains", Assert.IsType <StringContainsFilter>(actual).Method);
        }
Exemplo n.º 6
0
        public void Create_ForEnumType()
        {
            IGridFilter?actual = filters.Create(typeof(TestEnum), "EQUALS", Array.Empty <String>());

            Assert.Equal("equals", Assert.IsType <EnumFilter>(actual).Method);
        }
Exemplo n.º 7
0
        public void Create_ForNullableType()
        {
            IGridFilter?actual = filters.Create(typeof(Int32?), "EQUALS", Array.Empty <String>());

            Assert.Equal("equals", Assert.IsType <NumberFilter <Int32> >(actual).Method);
        }
Exemplo n.º 8
0
        public void Create_ForEnumerableEnumType()
        {
            IGridFilter?actual = filters.Create(typeof(IEnumerable <TestEnum>), "Equals", "");

            Assert.Equal("equals", Assert.IsType <EnumerableFilter <EnumFilter> >(actual).Method);
        }
Exemplo n.º 9
0
        public void Create_ForEnumerableType(Type type)
        {
            IGridFilter?actual = filters.Create(type, "CONTAINS", "");

            Assert.Equal("contains", Assert.IsType <EnumerableFilter <StringFilter> >(actual).Method);
        }
Exemplo n.º 10
0
        public void Create_ForEnumType(Type type)
        {
            IGridFilter?actual = filters.Create(type, "EQUALS", "");

            Assert.Equal("equals", Assert.IsType <EnumFilter>(actual).Method);
        }