public override void FixtureSetup() { base.FixtureSetup(); var serviceContext = (ServiceContext)MerchelloContext.Current.Services; _resolver = new MigrationResolver( Logger.CreateWithDefaultLog4NetConfiguration(), PluginManager.Current.ResolveMerchelloMigrations()); }
public virtual void TearDown() { PluginManager.Current = null; SqlSyntaxContext.SqlSyntaxProvider = null; MigrationResolver.Reset(); TestHelper.CleanContentDirectories(); Path = TestHelper.CurrentAssemblyDirectory; AppDomain.CurrentDomain.SetData("DataDirectory", null); DatabaseSpecificTearDown(); }
private void RunMigrations(ApplicationContext applicationContext) { if (HttpContext.Current != null && HttpContext.Current.User == null) { HttpContext.Current.User = new GenericPrincipal(new GenericIdentity("0"), new string[0]); } var recordRepository = new DatabaseMigrationRecordRepository(applicationContext.DatabaseContext.Database); var migrationResolver = new MigrationResolver( new AppDomainAssemblyMigrationTypeProvider(LogManager.GetLogger(typeof(AppDomainAssemblyMigrationTypeProvider))) ); var context = new MigrationContext( new ServiceContextWrapper(applicationContext.Services), applicationContext.DatabaseContext.Database, applicationContext.ApplicationCache, recordRepository, new MigrationConfiguration() ); var logger = LogManager.GetLogger(typeof(UmbracoMigrator)); var migrator = new UmbracoMigrator(migrationResolver, context, logger); migrator.Run(); }
public void TearDown() { MigrationResolver.Reset(); }
public void TearDown() { MigrationResolver.Reset(); Resolution.IsFrozen = false; }
public void TearDown() { LoggerResolver.Reset(); MigrationResolver.Reset(); }