using LCU.API.Internal.DocumentLib.Utilities; using Mongo2Go; using MongoDB.Driver; namespace LCU.API.Internal.DocumentLibTest.TestDoubles; public class FakeMongoCollectionFactory : IMongoCollectionFactory, IDisposable { private readonly MongoDbRunner _runner = MongoDbRunner.Start(); public IMongoCollection GetCollection() => new MongoClient(_runner.ConnectionString) .GetDatabase(typeof(T).Name) .GetCollection(typeof(T).Name); public void Dispose() { _runner.Dispose(); } }