flexyford / impagination

A lazy data layer for your paged records
102 stars 7 forks source link

Rehabilitate the test suite #7

Closed cowboyd closed 8 years ago

cowboyd commented 8 years ago

Convert the remaining test cases to use the simulation server

flexyford commented 8 years ago

Dataset - New Test Suite

Instanting a new Dataset

with default constructor values

fetching a page

immutable states

resolving a fetch request

rejecting a fetch request

changing the readOffset

not changing the readOffset

Loading Records

with setReadOffset at the start of the dataset

with less than one page loadHorizon

with less than two pages loadHorizon

resolving all requests
rejecting all requests
incrementing the readOffset to the next page
decrementing the readOffset past 0

with setReadOffset at the middle of the dataset

with less than one page loadHorizon

with less than two pages loadHorizon

incrementing the read offset to the next page before resolving any pages
resolving all requests

incrementing the readOffset to the next page

decrementing the readOffset to the prev page

Statistics

when fetch() returns totalPages

resolving the request with totalPages stats

Setting the offset to the end of the dataset

Setting the offset past the loadHorizon boundary of the dataset

rejecting the request with totalPages stats

flexyford commented 8 years ago

Check it out on #20