Example #1
0
        public void GetTop10RecordsTest()
        {
            string          query = this.GenerateQueryString(1000);
            DataResultTable dt    = this.client.GetResultTable(query, 10);

            Assert.Equal(10, dt.Count);
        }
Example #2
0
        public void GetLimitedRecordsTest()
        {
            string query = this.GenerateQueryString(100);

            DataResultTable dt = this.client.GetLimitedRecords(query, 20, 20);

            Assert.Equal(20, dt.Count);

            int firstRecord = dt[0].GetValue <int>("n");
            int lastRecord  = dt[dt.Count - 1].GetValue <int>("n");

            Assert.Equal(21, firstRecord);
            Assert.Equal(40, lastRecord);
        }
        public void GetReversedLimitedRecordsTest()
        {
            string query = this.GenerateQueryString(100, true);

            DataResultTable dt = this.client.GetResultTable(query, 10);

            Assert.Equal(10, dt.Count);

            int firstRecord = dt[0].GetValue <int>("n");
            int lastRecord  = dt[dt.Count - 1].GetValue <int>("n");

            Assert.Equal(100, firstRecord);
            Assert.Equal(91, lastRecord);
        }
Example #4
0
        public void PagedResultTableMassTest(int page, int pageSize, int expCount, int expFirst, int expLast)
        {
            string query = this.GenerateQueryString(1000);

            DataResultTable dt = this.client.GetPagedResultTable(query, page, pageSize);

            Assert.Equal(expCount, dt.Count);

            if (dt.Count > 0)
            {
                int firstRecord = dt[0].GetValue <int>("n");
                int lastRecord  = dt[dt.Count - 1].GetValue <int>("n");

                Assert.Equal(expFirst, firstRecord);
                Assert.True(expLast == lastRecord);
            }
        }