You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

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