Open
Description
Add interface/support to unit test ODataQueryOptions with a mock framework. I implemented logic using the following sample from here Server-Driven Paging. The code works, however, i am unable to unit test due to complexity of creating ODataQueryOptions
public PageResult<Product> Get(ODataQueryOptions<Product> options)
{
ODataQuerySettings settings = new ODataQuerySettings()
{
PageSize = 5
};
IQueryable results = options.ApplyTo(_products.AsQueryable(), settings);
return new PageResult<Product>(
results as IEnumerable<Product>,
Request.GetNextPageLink(),
Request.GetInlineCount());
}
Assemblies affected
Microsoft.AspNet.OData.Query (7.0.1)
Reproduce steps
Create unit test sample outside "Microsoft.AspNet.OData" package.
Expected result
Able to easily create unit test for logic passing in a ODataQueryOptions
Actual result
unable to create unit tests