I have a service which consumes a change stream.
The service dependens on a connected IMongoClient and the stream issetup like this:
changeStreamCursor = await mongoClient.WatchAsync();
and listened to by something like this:
var streamTask = changeStreamCursor.ForEachAsync(change => HandleTheChange(change));
The the question: How to mock the IMongoClient and the IMongoClient and the IChangeStreamCursor and telling the mock to stream a document?
(I am using MSTest and Moq, but not necessarily)