Files
base_abp/test/ASPBaseOIDC.Web.Tests/ASPBaseOIDCWebTestModule.cs
2025-10-01 21:16:23 -06:00

39 lines
1.1 KiB
C#

using Abp.AspNetCore;
using Abp.AspNetCore.TestBase;
using Abp.Modules;
using Abp.Reflection.Extensions;
using ASPBaseOIDC.EntityFrameworkCore;
using ASPBaseOIDC.Web.Startup;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
namespace ASPBaseOIDC.Web.Tests;
[DependsOn(
typeof(ASPBaseOIDCWebMvcModule),
typeof(AbpAspNetCoreTestBaseModule)
)]
public class ASPBaseOIDCWebTestModule : AbpModule
{
public ASPBaseOIDCWebTestModule(ASPBaseOIDCEntityFrameworkModule 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(ASPBaseOIDCWebTestModule).GetAssembly());
}
public override void PostInitialize()
{
IocManager.Resolve<ApplicationPartManager>()
.AddApplicationPartsIfNotAddedBefore(typeof(ASPBaseOIDCWebMvcModule).Assembly);
}
}