PageTestImpl<T>
Namespace: SlottyMedia.Tests.TestImpl
This class is a test implementation of . It allows to set all fields of a page and does not provide any actual functionalities. Use for mocking purposes only!
public class PageTestImpl<T> : , , System.Collections.IEnumerable
Type Parameters
T
The type of the page's content
Inheritance Object → PageTestImpl<T>
Implements IPage<T>, IEnumerable<T>, IEnumerable
Properties
PageNumber
public int PageNumber { get; }
Property Value
PageSize
public int PageSize { get; }
Property Value
TotalPages
public int TotalPages { get; }
Property Value
Content
public List<T> Content { get; }
Property Value
List<T>
Constructors
PageTestImpl(List<T>, Int32, Int32, Int32)
Initializes a new page with the given members.
public PageTestImpl(List<T> content, int pageNumber, int pageSize, int totalPages)
Parameters
content List<T>
pageNumber Int32
pageSize Int32
totalPages Int32
Methods
GetEnumerator()
public IEnumerator<T> GetEnumerator()
Returns
IEnumerator<T>
Map<TMapped>(Func<T, TMapped>)
public IPage<TMapped> Map<TMapped>(Func<T, TMapped> function)
Type Parameters
TMapped
Parameters
function Func<T, TMapped>
Returns
IPage<TMapped>
Fetch(Int32)
Simulates fetching some other page, but simply returns this object.
public Task<IPage<T>> Fetch(int pageNumber)
Parameters
pageNumber Int32
Returns
Task<IPage<T>>