BMC/BCS.BMC/test/BCS.BMC.Web.Tests/BMCWebTestModule.cs
2022-10-10 20:44:01 +05:30

38 lines
1.1 KiB
C#

using Abp.AspNetCore;
using Abp.AspNetCore.TestBase;
using Abp.Modules;
using Abp.Reflection.Extensions;
using BCS.BMC.EntityFrameworkCore;
using BCS.BMC.Web.Startup;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
namespace BCS.BMC.Web.Tests
{
[DependsOn(
typeof(BMCWebMvcModule),
typeof(AbpAspNetCoreTestBaseModule)
)]
public class BMCWebTestModule : AbpModule
{
public BMCWebTestModule(BMCEntityFrameworkModule abpProjectNameEntityFrameworkModule)
{
abpProjectNameEntityFrameworkModule.SkipDbContextRegistration = true;
}
public override void PreInitialize()
{
Configuration.UnitOfWork.IsTransactional = false; //EF Core InMemory DB does not support transactions.
}
public override void Initialize()
{
IocManager.RegisterAssemblyByConvention(typeof(BMCWebTestModule).GetAssembly());
}
public override void PostInitialize()
{
IocManager.Resolve<ApplicationPartManager>()
.AddApplicationPartsIfNotAddedBefore(typeof(BMCWebMvcModule).Assembly);
}
}
}