Only seen two questions on here for this, one wasn't answered and one was an unusable answer (maybe I just didn't get it). I want to mock this:
var eventsFeed = this.documentClient.CreateDocumentQuery(this.collectionUri,
sqlExpression, feedOptions).AsDocumentQuery();
var events = await eventsFeed.ExecuteNextAsync(cancellationToken);
I only seem to be able to get this error:
Unable to cast object of type 'System.Linq.EnumerableQuery to type 'Microsoft.Azure.Documents.Linq.IDocumentQuery
There is a possible answer here:
but I can't find the type JTokenEx used in the example and there is no explanation of how to write the mock code?
Ideally I'd like to return some mock results so that I can test the ExecuteNextAsync.
For reference here's the other question I found relating to it but again it wasn't answered:
How to (should I) mock DocumentClient for DocumentDb unit testing?
Any help would be greatly appreciated. Thanks