public void GivenNoRegisteredMigrations_ThenPlanIsReturned() { PendingPackageMigrations pendingPackageMigrations = GetPendingPackageMigrations(); var registeredMigrations = new Dictionary <string, string>(); IReadOnlyList <string> pending = pendingPackageMigrations.GetPendingPackageMigrations(registeredMigrations); Assert.AreEqual(1, pending.Count); }
public void GivenRegisteredMigration_WhenStepIsDifferentCase_ThenPlanIsReturned() { PendingPackageMigrations pendingPackageMigrations = GetPendingPackageMigrations(); var registeredMigrations = new Dictionary <string, string> { [Constants.Conventions.Migrations.KeyValuePrefix + TestPackageName] = s_step1.ToString().ToUpper() }; IReadOnlyList <string> pending = pendingPackageMigrations.GetPendingPackageMigrations(registeredMigrations); Assert.AreEqual(1, pending.Count); }
public void GivenRegisteredMigration_WhenFinalStepMatched_ThenNoneAreReturned() { PendingPackageMigrations pendingPackageMigrations = GetPendingPackageMigrations(); var registeredMigrations = new Dictionary <string, string> { [Constants.Conventions.Migrations.KeyValuePrefix + TestPackageName] = s_step2.ToString() }; IReadOnlyList <string> pending = pendingPackageMigrations.GetPendingPackageMigrations(registeredMigrations); Assert.AreEqual(0, pending.Count); }
/// <summary> /// Initializes a new instance of the <see cref="RuntimeState"/> class. /// </summary> public RuntimeState( IOptions <GlobalSettings> globalSettings, IOptions <UnattendedSettings> unattendedSettings, IUmbracoVersion umbracoVersion, IUmbracoDatabaseFactory databaseFactory, ILogger <RuntimeState> logger, PendingPackageMigrations packageMigrationState) { _globalSettings = globalSettings; _unattendedSettings = unattendedSettings; _umbracoVersion = umbracoVersion; _databaseFactory = databaseFactory; _logger = logger; _packageMigrationState = packageMigrationState; }
public PackageMigrationRunner( IProfilingLogger profilingLogger, ICoreScopeProvider scopeProvider, PendingPackageMigrations pendingPackageMigrations, PackageMigrationPlanCollection packageMigrationPlans, IMigrationPlanExecutor migrationPlanExecutor, IKeyValueService keyValueService, IEventAggregator eventAggregator) { _profilingLogger = profilingLogger; _scopeProvider = scopeProvider; _pendingPackageMigrations = pendingPackageMigrations; _migrationPlanExecutor = migrationPlanExecutor; _keyValueService = keyValueService; _eventAggregator = eventAggregator; _packageMigrationPlans = packageMigrationPlans.ToDictionary(x => x.Name); }
public RuntimeState( IOptions <GlobalSettings> globalSettings, IOptions <UnattendedSettings> unattendedSettings, IUmbracoVersion umbracoVersion, IUmbracoDatabaseFactory databaseFactory, ILogger <RuntimeState> logger, PendingPackageMigrations packageMigrationState) : this( globalSettings, unattendedSettings, umbracoVersion, databaseFactory, logger, packageMigrationState, StaticServiceProvider.Instance.GetRequiredService <IConflictingRouteService>()) { }
/// <summary> /// Initializes a new instance of the <see cref="RuntimeState" /> class. /// </summary> public RuntimeState( IOptions <GlobalSettings> globalSettings, IOptions <UnattendedSettings> unattendedSettings, IUmbracoVersion umbracoVersion, IUmbracoDatabaseFactory databaseFactory, ILogger <RuntimeState> logger, PendingPackageMigrations packageMigrationState, IConflictingRouteService conflictingRouteService, IEnumerable <IDatabaseProviderMetadata> databaseProviderMetadata, IRuntimeModeValidationService runtimeModeValidationService) { _globalSettings = globalSettings; _unattendedSettings = unattendedSettings; _umbracoVersion = umbracoVersion; _databaseFactory = databaseFactory; _logger = logger; _packageMigrationState = packageMigrationState; _conflictingRouteService = conflictingRouteService; _databaseProviderMetadata = databaseProviderMetadata; _runtimeModeValidationService = runtimeModeValidationService; }