コード例 #1
0
        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();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
 public static bool ContainsAtLeast <T>(this IQueryable <T> source, int count)
 {
     return(Colls.ContainsAtLeast(source, count));
 }
コード例 #5
0
 public static bool ContainsAtLeast <T>(this IEnumerable <T> source, Expression <Func <T, bool> > condition, int count)
 {
     return(Colls.ContainsAtLeast(source, condition, count));
 }
コード例 #6
0
 public static bool ContainsAtLeast <T>(this ICollection <T> source, int count)
 {
     return(Colls.ContainsAtLeast(source, count));
 }