dotnet-object-storage/PoweredSoft.ObjectStorage.MongoDB.Tests/Mock/MongoDatabaseFactory.cs

27 lines
639 B
C#
Raw Normal View History

2019-02-12 17:39:16 -05:00
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;
}
2019-02-12 23:39:55 -05:00
public static MongoObjectStorageContext GetObjectStorageContext()
2019-02-12 17:39:16 -05:00
{
2019-02-12 23:39:55 -05:00
return new MongoObjectStorageContext(GetDatabase());
2019-02-12 17:39:16 -05:00
}
public static IMongoClient GetClient()
{
var mongoClient = new MongoClient();
return mongoClient;
}
}
}