private void AddRecords(StoragePage page, TestData[] data) { foreach (TestData test in data) { try { int result = page.AddRecord(test.data); Assert.AreEqual(test.recordIdx, result, string.Format("Return value did not match. Test Data=[{0}]", test.ToString())); } catch (Exception e) { Assert.AreEqual(test.exception, e.GetType().Name, "Unexpected exception. Test Data = [{0}]", test.ToString()); } } }
private void CreateNewPage(int count, StoragePageManager freeSpaceMgr) { // create a new header object ListHdr header = new ListHdr() { NextPageIndex = ListHdr.EOLPageIndex, TotalEntriesCount = count, PageEntriesCount = 0, PageWriteIndex = freeSpaceMgr.GetFreePage() }; this.pageHeaderList.Push(header); // create the page - and write a placeholder record for the header StoragePage page = new StoragePage(); page.AddRecord(header); this.pageList.Push(page); }