1234567891011121314151617181920212223242526272829303132333435363738 |
- 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<ApplicationPartManager>()
- .AddApplicationPartsIfNotAddedBefore(typeof(ImageServerWebMvcModule).Assembly);
- }
- }
- }
|