VberAdminWebTestModule.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Abp.AspNetCore;
  2. using Abp.AspNetCore.TestBase;
  3. using Abp.Modules;
  4. using Abp.Reflection.Extensions;
  5. using VberAdmin.EntityFrameworkCore;
  6. using VberAdmin.Web.Startup;
  7. using Microsoft.AspNetCore.Mvc.ApplicationParts;
  8. namespace VberAdmin.Web.Tests;
  9. [DependsOn(
  10. typeof(VberAdminWebMvcModule),
  11. typeof(AbpAspNetCoreTestBaseModule)
  12. )]
  13. public class VberAdminWebTestModule : AbpModule
  14. {
  15. public VberAdminWebTestModule(VberAdminEfModule abpProjectNameEfModule)
  16. {
  17. abpProjectNameEfModule.SkipDbContextRegistration = true;
  18. }
  19. public override void PreInitialize()
  20. {
  21. Configuration.UnitOfWork.IsTransactional = false; //EF Core InMemory DB does not support transactions.
  22. }
  23. public override void Initialize()
  24. {
  25. IocManager.RegisterAssemblyByConvention(typeof(VberAdminWebTestModule).GetAssembly());
  26. }
  27. public override void PostInitialize()
  28. {
  29. IocManager.Resolve<ApplicationPartManager>()
  30. .AddApplicationPartsIfNotAddedBefore(typeof(VberAdminWebMvcModule).Assembly);
  31. }
  32. }