adding
This commit is contained in:
+19
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user