public void ContainsAtLeastAsQueryExpressionTest() { var query = new List <int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }.AsQueryable(); var val0 = Colls.ContainsAtLeast(query, 9); var val1 = Colls.ContainsAtLeast(query, 10); var val2 = Colls.ContainsAtLeast(query, 11); val0.ShouldBeTrue(); val1.ShouldBeTrue(); val2.ShouldBeFalse(); }
public void ContainsAtLeastWithGivenExpressionTest() { var list = new List <int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; var val0 = Colls.ContainsAtLeast(list, v => v > 9, 1); var val1 = Colls.ContainsAtLeast(list, v => v > 10, 0); var val2 = Colls.ContainsAtLeast(list, v => v > 11, 2); val0.ShouldBeTrue(); val1.ShouldBeTrue(); val2.ShouldBeFalse(); }
public void ContainsAtLeastWithoutExpressionTest() { var list = new List <int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; var val0 = Colls.ContainsAtLeast(list, 9); var val1 = Colls.ContainsAtLeast(list, 10); var val2 = Colls.ContainsAtLeast(list, 11); val0.ShouldBeTrue(); val1.ShouldBeTrue(); val2.ShouldBeFalse(); }
public static bool ContainsAtLeast <T>(this IQueryable <T> source, int count) { return(Colls.ContainsAtLeast(source, count)); }
public static bool ContainsAtLeast <T>(this IEnumerable <T> source, Expression <Func <T, bool> > condition, int count) { return(Colls.ContainsAtLeast(source, condition, count)); }
public static bool ContainsAtLeast <T>(this ICollection <T> source, int count) { return(Colls.ContainsAtLeast(source, count)); }