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