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.
abp/modules/users/test/Volo.Abp.Users.MongoDB.Tests/Volo/Abp/Users/MongoDB/AbpUsersMongoDbTestModule.cs

32 lines
945 B

using System;
using Microsoft.Extensions.DependencyInjection;
using Mongo2Go;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
namespace Volo.Abp.Users.MongoDB
{
[DependsOn(
typeof(AbpUsersMongoDbModule),
typeof(AbpUsersTestsSharedModule)
)]
public class AbpUsersMongoDbTestModule : AbpModule
{
private static readonly MongoDbRunner MongoDbRunner = MongoDbRunner.Start();
public override void ConfigureServices(IServiceCollection services)
{
var connectionString = MongoDbRunner.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");
Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = connectionString;
});
services.AddAssemblyOf<AbpUsersMongoDbTestModule>();
}
}
}