コード例 #1
0
        public void ItShouldNotFilterComplexAndFiltersWhenFirstNotFilter()
        {
            var filter1 = new Filter <int, bool>("{0} > {1}")
            {
                Sequence = 1
            };

            filter1.SetParameters(new List <IMonthlyParameter <int> > {
                SetDictionary("0", 10), SetDictionary("1", 20)
            });
            var filter2 = new Filter <int, bool>("{2} = {3}")
            {
                Sequence = 2
            };

            filter2.SetConnector("AND");
            filter2.SetParameters(new List <IMonthlyParameter <int> > {
                SetDictionary("2", 10), SetDictionary("3", 10)
            });
            var concept = new Concept <int>();

            concept.AddFilter(filter1);
            concept.AddFilter(filter2);
            Assert.IsFalse(concept.Filter(Month.January));
        }
コード例 #2
0
        public void ItShouldFilterWhenFilterSuccess()
        {
            var filter = new Filter <int, bool>("{0} > {1}")
            {
                Parameter1 = SetDictionary("0", 10),
                Parameter2 = SetDictionary("1", 1)
            };
            var concept = new Concept <int>();

            concept.AddFilter(filter);
            Assert.IsTrue(concept.Filter(Month.January));
        }
コード例 #3
0
        public void ItShouldNotFilterWhenNoFilter()
        {
            var concept = new Concept <int>();

            Assert.IsTrue(concept.Filter(Month.January));
        }