dotnet-object-storage/PoweredSoft.ObjectStorage.MongoDB.Tests/Mock/MongoDatabaseFactory.cs
2019-02-12 23:39:55 -05:00

27 lines
639 B
C#

using System;
using MongoDB.Driver;
namespace PoweredSoft.ObjectStorage.MongoDB.Tests.Mock
{
public class MongoDatabaseFactory
{
public static IMongoDatabase GetDatabase()
{
var client = GetClient();
var db = client.GetDatabase("acme");
return db;
}
public static MongoObjectStorageContext GetObjectStorageContext()
{
return new MongoObjectStorageContext(GetDatabase());
}
public static IMongoClient GetClient()
{
var mongoClient = new MongoClient();
return mongoClient;
}
}
}