public void Order_by_ID_desc_must_return_7_items_in_descending_order()
 {
     var dri = new DataRetrievalInfo<WebLog> {
         SortingInfo = new SortingInfo {
             SortingEnabled = true,
             SortProperty = "ID",
             Order = SortOrder.Descending,
         }
     };
     var items = webLogService.Select(dri);
     var ids = ListToString(items);
     var rIDs = ListToString(webLogs.OrderByDescending(w => w.ID));
     Assert.AreEqual(ids, rIDs);
 }
        public void Pagesize_10_and_pageindex_2_must_yield_page_1()
        {
            var dri = new DataRetrievalInfo<WebLog>
            {
                PagingInfo = new PagingInfo
                {
                    PageIndex = 2,
                    PageSize = 10,
                    PagingEnabled = true,
                },
            };

            var page2 = webLogService.Select(dri);

            dri.PagingInfo.PageIndex = 1;

            var page1 = webLogService.Select(dri);

            Assert.AreEqual(ListToString(page1), ListToString(page2));
        }
 public void Search_with_null_parameters_must_return_all_7_rows()
 {
     var dri = new DataRetrievalInfo<WebLog>();
     var items = webLogService.Select(dri);
     Assert.AreEqual(webLogs.ToList().Count, dri.TotalItemCount);
 }
        public void Pagesize_2_and_pageindex_2_order_by_ID_asc_yields_ids_3_and_4()
        {
            var dri = new DataRetrievalInfo<WebLog> {
                SortingInfo = new SortingInfo {
                    SortingEnabled = true,
                    SortProperty = "ID",
                },
                PagingInfo = new PagingInfo {
                    PageIndex = 2,
                    PageSize = 2,
                    PagingEnabled = true,                    
                },
            };

            var result = webLogService.Select(dri);

            Assert.AreEqual(2, result.Count);
            Assert.AreEqual(3, result[0].ID);
            Assert.AreEqual(4, result[1].ID);
        }