yuriyoleynikov / YoTennis

Application for Tennis stats.
0 stars 0 forks source link

Implement pagination correction logic #13

Closed Igorbek closed 7 years ago

Igorbek commented 7 years ago

Create a function with following signature:

public static (int count, int skip) CorrectPagination(
  int totalCount,
  int count,
  int skip,
  int defaultCount = 10);

// Example
return (10, 20); // count = 10, skip = 20
return (count: 10, skip: 20);

Contract:

(should throw an appropriate exception)

Acceptance criteria:

var (count, skip) = CorrectPagination(totalCount, requestedCount, requestSkip, defaultCount);
Igorbek commented 7 years ago

/cc @yuriyoleynikov see updates

yuriyoleynikov commented 7 years ago

Closed in #12