This commit is contained in:
Zeeshaun
2026-03-13 09:11:35 -05:00
parent f004c8205a
commit c2d6bda458
197 changed files with 14970 additions and 0 deletions
@@ -0,0 +1,19 @@
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<T> GetCollection<T>() => new MongoClient(_runner.ConnectionString)
.GetDatabase(typeof(T).Name)
.GetCollection<T>(typeof(T).Name);
public void Dispose()
{
_runner.Dispose();
}
}