, free & fully virtual. Register Now, free & fully virtual. Register Now

Unit Test BulkWriteAsync using C#

I am having trouble writing a unit test for a method that uses Mongo Driver BulkWriteAsync().
The return for BulkWriteAsync() is BulkWriteResult which is an abstract class and I am not able to mock it. So I create a concrete class call MockBulkWriteResult which inherits BulkWriteResult.

Here is a sample code:
var response = new MockBulkWriteResult(5);

        var mockCollection = new Mock<IMongoCollection<Dto>>();
            .Setup(x => x.BulkWriteAsync(

Any suggestions?