| 123456789101112131415161718192021222324252627282930313233343536 |
- using System.Data.Entity;
- using Abp.Modules;
- using Abp.Reflection.Extensions;
- using Abp.TestBase;
- using Castle.MicroKernel.Registration;
- using IwbZero.MultiTenancy;
- using IwbZero.Zero.Configuration;
- using NSubstitute;
- using WePlatform.EF;
- namespace WePlatform
- {
- [DependsOn(
- typeof(WePlatformApplicationModule),
- typeof(WePlatformDataModule),
- typeof(AbpTestBaseModule))]
- public class WePlatformTestModule : AbpModule
- {
- public override void PreInitialize()
- {
- //Use database for language management
- Configuration.Modules.Zero().LanguageManagement.EnableDbLocalization();
- //Registering fake services
- IocManager.IocContainer.Register(
- Component.For<IIwbDbMigrator>()
- .UsingFactoryMethod(() => Substitute.For<IIwbDbMigrator>())
- .LifestyleSingleton()
- );
- Database.SetInitializer(new CreateDatabaseIfNotExists<WePlatformDbContext>());
- }
- }
- }
|