public void Test_GetdataPage_WhenRecordsInDataSource_ShouldReturnRecords() { //---------------Set up test pack------------------- BindingListRequest <FakeBO> request = new BindingListRequest <FakeBO>(); PageProvider <FakeBO> pageProvider = new PageProvider <FakeBO>(request); BOTestFactory <FakeBO> assetFactory = BOTestFactoryRegistry.Instance.Resolve <FakeBO>(); assetFactory.CreateManySavedBusinessObject(40); //---------------Assert Precondition---------------- Assert.IsNullOrEmpty(pageProvider.Filter); Assert.AreEqual(0, request.PageNumber); Assert.AreEqual(20, request.RowsPerPage); //---------------Execute Test ---------------------- IList <FakeBO> dataPage = pageProvider.GetDataPage(0); //---------------Test Result ----------------------- Assert.AreEqual(request.RowsPerPage, dataPage.Count); //dataPage. }
public void Test_GetdataPage_WhenRecordsInDataSource_ShouldReturnRecords() { //---------------Set up test pack------------------- BindingListRequest<FakeBO> request = new BindingListRequest<FakeBO>(); PageProvider<FakeBO> pageProvider = new PageProvider<FakeBO>(request); BOTestFactory<FakeBO> assetFactory = BOTestFactoryRegistry.Instance.Resolve<FakeBO>(); assetFactory.CreateManySavedBusinessObject(40); //---------------Assert Precondition---------------- Assert.IsNullOrEmpty(pageProvider.Filter); Assert.AreEqual(0, request.PageNumber); Assert.AreEqual(20, request.RowsPerPage); //---------------Execute Test ---------------------- IList<FakeBO> dataPage = pageProvider.GetDataPage(0); //---------------Test Result ----------------------- Assert.AreEqual(request.RowsPerPage, dataPage.Count); //dataPage. }