예제 #1
0
        public void GivenNoRegisteredMigrations_ThenPlanIsReturned()
        {
            PendingPackageMigrations pendingPackageMigrations = GetPendingPackageMigrations();
            var registeredMigrations       = new Dictionary <string, string>();
            IReadOnlyList <string> pending = pendingPackageMigrations.GetPendingPackageMigrations(registeredMigrations);

            Assert.AreEqual(1, pending.Count);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
 /// <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;
 }
예제 #5
0
 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);
 }
예제 #6
0
 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>())
 {
 }
예제 #7
0
 /// <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;
 }