コード例 #1
0
        public ActionResult ToDoList(DateFilterModel d)
        {
            if (d.Status == "null")
            {
                d.Status = null;
            }
            var model = FilterFunction.Filter(d);

            return(View(model));
        }
コード例 #2
0
ファイル: Itertools.cs プロジェクト: sembug/itertools
 public static IEnumerable <Tuple <T1, T2, T3> > Filter <T1, T2, T3>
 (
     this IEnumerable <Tuple <T1, T2, T3> > iterable,
     Func <T1, T2, T3, int, bool> valueFactory
 )
 {
     return(FilterFunction.Filter
            (
                valueFactory,
                iterable
            ));
 }
コード例 #3
0
        public void FilterTestShoulWork()
        {
            var listOfFilter = new List <int>()
            {
                1, 2, 3, 4
            };

            listOfFilter = FilterFunction.Filter(listOfFilter, x => x > 0);

            Assert.IsTrue(listOfFilter.Contains(2));
            Assert.IsFalse(listOfFilter.Contains(-1));
        }
コード例 #4
0
        public void FilterTestShoulWorkWithAddZeroValue()
        {
            var listOfFilter = new List <int>()
            {
                0, 0, 1, 0
            };

            listOfFilter = FilterFunction.Filter(listOfFilter, x => x > 0);

            Assert.IsTrue(listOfFilter.Contains(1));
            Assert.IsFalse(listOfFilter.Contains(0));
        }
コード例 #5
0
        public void FilterTestShoulWorkWhenWeDoNotAddValues()
        {
            var listOfFilter = new List <int>()
            {
            };

            listOfFilter = FilterFunction.Filter(listOfFilter, x => x > 0);

            for (int i = 0; i <= 10; i++)
            {
                Assert.IsFalse(listOfFilter.Contains(i));
            }
        }