mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
966 B
34 lines
966 B
using Microsoft.Extensions.DependencyInjection;
|
|
using Mongo2Go;
|
|
using Volo.Abp.Data;
|
|
using Volo.Abp.Modularity;
|
|
|
|
namespace Volo.Abp.TenantManagement.MongoDb
|
|
{
|
|
[DependsOn(
|
|
typeof(AbpTenantManagementMongoDbModule),
|
|
typeof(AbpTenantManagementTestBaseModule)
|
|
)]
|
|
public class AbpTenantManagementMongoDbTestModule : AbpModule
|
|
{
|
|
private MongoDbRunner _mongoDbRunner;
|
|
|
|
public override void ConfigureServices(IServiceCollection services)
|
|
{
|
|
_mongoDbRunner = MongoDbRunner.Start();
|
|
|
|
services.Configure<DbConnectionOptions>(options =>
|
|
{
|
|
options.ConnectionStrings.Default = _mongoDbRunner.ConnectionString;
|
|
});
|
|
|
|
services.AddAssemblyOf<AbpTenantManagementMongoDbTestModule>();
|
|
}
|
|
|
|
public override void OnApplicationShutdown(ApplicationShutdownContext context)
|
|
{
|
|
_mongoDbRunner.Dispose();
|
|
}
|
|
}
|
|
}
|