public ActionResult ToDoList(DateFilterModel d) { if (d.Status == "null") { d.Status = null; } var model = FilterFunction.Filter(d); return(View(model)); }
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 )); }
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)); }
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)); }
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)); } }