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.
37 lines
1.2 KiB
37 lines
1.2 KiB
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Volo.Abp.EntityFrameworkCore;
|
|
using Volo.Abp.Modularity;
|
|
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
|
|
using Volo.Abp.Uow;
|
|
|
|
namespace Volo.Abp.PermissionManagement
|
|
{
|
|
[DependsOn(
|
|
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
|
|
typeof(AbpPermissionManagementTestBaseModule))]
|
|
public class AbpPermissionManagementTestModule : AbpModule
|
|
{
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
{
|
|
context.Services.AddEntityFrameworkInMemoryDatabase();
|
|
|
|
var databaseName = Guid.NewGuid().ToString();
|
|
|
|
Configure<AbpDbContextOptions>(options =>
|
|
{
|
|
options.Configure(abpDbContextConfigurationContext =>
|
|
{
|
|
abpDbContextConfigurationContext.DbContextOptions.UseInMemoryDatabase(databaseName);
|
|
});
|
|
});
|
|
|
|
Configure<UnitOfWorkDefaultOptions>(options =>
|
|
{
|
|
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; //EF in-memory database does not support transactions
|
|
});
|
|
}
|
|
}
|
|
}
|