Want to mock MongoDB.Driver in appropriate manner to store data in memory considering FilterDefinition and UpdateDefinition

0

I am writing integration test and want to mock MongoDB.Driver in appropriate manner to store data in memory considering FilterDefinition and UpdateDefinition so all the operations can be performed with in C# object using probably Lambda.

I appreciate any help on this.

I already tried to convert it to BsonDocument and build predicate accordingly but FilterDefinition is very complex and its hard to handle each aspect by using predicate manually.

var documentSerializer = BsonSerializer.SerializerRegistry.GetSerializer<TDocument>();
var renderedFilter = filters.Render(documentSerializer, BsonSerializer.SerializerRegistry); 

I also tried Mongo2Go but integration time is increasing by introducing this.