Default PageSize of PageInfo class inconsistent with defaults applied by Criteria<T>

Found in

EPiServer.Social.Framework 1.0.0

Fixed in

EPiServer.Social.Framework 1.3.0

Created

Feb 01, 2017

Updated

Apr 20, 2017

State

Closed, Fixed and tested


Description

When Criteria<T> is constructed, it defaults its PageInfo to a size of 10 and an offset of 0 (as expected). The platform uses a default page size of 10 throughout all of its features. However, when a new PageInfo is constructed directly, it defaults its PageInfo to a size of 0 and an offset of 0. This results in confusing and unanticipated behavior when a developer attempts to assign a PageInfo to Criteria<T> upon construction (a common practice).

Steps to Reproduce:
1. Instantiate a new Criteria<T> as demonstrated below:

var defaultCriteria = new Criteria<CommentFilter>()

2. Instantiate a new Criteria<T> and assign new PageInfo as demonstrated below:

var criteriaWithNewPageInfo = new Criteria<CommentFilter>
{
    PageInfo = new PageInfo()
}

3. Compare the values of defaultCriteria.PageInfo.PageSize to criteriaWithNewPageInfo.PageInfo.PageSize

Expected Result
defaultCriteria.PageInfo.PageSize == 10
criteriaWithNewPageInfo.PageInfo.PageSize == 10

Actual Result
defaultCriteria.PageInfo.PageSize == 10
criteriaWithNewPageInfo.PageInfo.PageSize == 0