Beispiel #1
0
        public void ListTest5(Table tbl, uint num)
        {
            StringRangeParams ps = new StringRangeParams();

            ps.Backward();
            PerformListTest(tbl, ps, num);
        }
Beispiel #2
0
        public void ListTest16(Table tbl, uint num)
        {
            StringRangeParams ps = new StringRangeParams();

            ps.Prefix("000000002");

            uint expected = 2000;

            PerformListTest(tbl, ps, expected);
        }
Beispiel #3
0
        public void ListTest8(Table tbl, uint num)
        {
            StringRangeParams ps = new StringRangeParams();

            ps.EndKey(Utils.Id(15000));

            uint expected = 15000;

            PerformListTest(tbl, ps, expected);
        }
Beispiel #4
0
        public void ListTest28(Table tbl, uint num)
        {
            for (uint i = 0; i < (num / 1000); i++)
            {
                StringRangeParams ps = new StringRangeParams();
                ps.Prefix("00000000" + i.ToString("D2"));

                uint expected = 1000;
                PerformListTest(tbl, ps, expected);
            }
        }
Beispiel #5
0
        public void ListTest18(Table tbl, uint num)
        {
            StringRangeParams ps = new StringRangeParams();

            ps.StartKey(Utils.Id(13000));
            ps.Prefix("0000000012");

            uint expected = 0;

            PerformListTest(tbl, ps, expected);
        }
Beispiel #6
0
        public void ListTest15(Table tbl, uint num)
        {
            StringRangeParams ps = new StringRangeParams();

            ps.Prefix("00000000120");
            ps.Backward();

            uint expected = 100;

            PerformListTest(tbl, ps, expected);
        }
Beispiel #7
0
        public void ListTest26(Table tbl, uint num)
        {
            for (uint i = 0; i < num; i += 1000)
            {
                StringRangeParams ps = new StringRangeParams();
                ps.StartKey(Utils.Id(i));
                ps.EndKey(Utils.Id(i + 1000));

                uint expected = 1000;
                PerformListTest(tbl, ps, expected);
            }
        }
Beispiel #8
0
        public void ListTest25(Table tbl, uint num)
        {
            StringRangeParams ps = new StringRangeParams();

            ps.StartKey(Utils.Id(22000));
            ps.EndKey(Utils.Id(18000));
            ps.Backward();

            uint expected = 3999;

            PerformListTest(tbl, ps, expected);
        }
Beispiel #9
0
        public void ListTest6(Table tbl, uint num)
        {
            uint count = 1234;

            StringRangeParams ps = new StringRangeParams();

            ps.Count(count);

            uint expected = count;

            PerformListTest(tbl, ps, expected);
        }
Beispiel #10
0
        public void ListTest13(Table tbl, uint num)
        {
            StringRangeParams ps = new StringRangeParams();

            ps.StartKey(Utils.Id(15000));
            ps.EndKey(Utils.Id(10000));
            ps.Prefix("00000000120");
            ps.Backward();

            uint expected = 100;

            PerformListTest(tbl, ps, expected);
        }
Beispiel #11
0
        public void ListTest1(Table tbl, uint num)
        {
            uint count = 111;

            StringRangeParams ps = new StringRangeParams();

            ps.StartKey(Utils.Id(100));
            ps.Count(count);

            uint expected = count;

            PerformListTest(tbl, ps, expected);
        }
Beispiel #12
0
        public void ListTest27(Table tbl, uint num)
        {
            for (uint i = num; i > 0; i -= 1000)
            {
                StringRangeParams ps = new StringRangeParams();
                ps.StartKey(Utils.Id(i));
                ps.EndKey(Utils.Id(i - 1000));
                ps.Backward();

                uint expected;
                if (i == 22000)
                {
                    expected = 999;
                }
                else
                {
                    expected = 1000;
                }
                PerformListTest(tbl, ps, expected);
            }
        }
Beispiel #13
0
        public void PerformListTest(Table tbl, StringRangeParams ps, uint expected)
        {
            int cnt;

            cnt = 0;
            foreach (String key in tbl.GetKeyIterator(ps))
            {
                //Console.WriteLine(key);
                cnt++;
            }
            Console.WriteLine("Expecting {0}, received {1}", expected, cnt);
            Assert.IsTrue(expected == cnt);

            cnt = 0;
            foreach (KeyValuePair <string, string> kv in tbl.GetKeyValueIterator(ps))
            {
                cnt++;
            }
            Console.WriteLine("Expecting {0}, received {1}", expected, cnt);
            Assert.IsTrue(expected == cnt);
        }