MigrateVersion7ValueIfNeeded() private method

private MigrateVersion7ValueIfNeeded ( ) : void
return void
コード例 #1
0
        public void MigrateVersion7ValueIfNeeded_7Set_Migrated()
        {
            // Setup
            using (m_helper.SetupVersion7ProjectSharedSetting())
                using (var version7Key = m_helper.SetupVersion7Settings())
                {
                    object projectsSharedValue;
                    // Verify that the version 8 ProjectShared key is missing before migration
                    Assert.IsFalse(RegistryHelper.RegEntryExists(FwRegistryHelper.FieldWorksRegistryKey, null, "ProjectShared", out projectsSharedValue));

                    FwRegistryHelper.MigrateVersion7ValueIfNeeded();

                    // Verification
                    // Verify that the version 8 ProjectShared key is set after migration.
                    Assert.IsTrue(RegistryHelper.RegEntryExists(FwRegistryHelper.FieldWorksRegistryKey, null, "ProjectShared", out projectsSharedValue));
                    Assert.IsTrue(bool.Parse((string)projectsSharedValue));

                    FwRegistryHelper.FieldWorksRegistryKey.SetValue("ProjectShared", "False");

                    FwRegistryHelper.MigrateVersion7ValueIfNeeded();

                    // Verification
                    // Verify that the version 7 ProjectShared value has not been migrated again.
                    Assert.IsTrue(RegistryHelper.RegEntryExists(FwRegistryHelper.FieldWorksRegistryKey, null, "ProjectShared", out projectsSharedValue));
                    Assert.IsFalse(bool.Parse((string)projectsSharedValue));
                }
        }
コード例 #2
0
        public void MigrateVersion7ValueIfNeeded_7Unset_NotMigrated()
        {
            // Setup
            using (var version7Key = m_helper.SetupVersion7Settings())
            {
                FwRegistryHelper.MigrateVersion7ValueIfNeeded();

                // Verification
                // Verify that the version 8 ProjectShared key is missing.
                object dummy;
                Assert.IsFalse(RegistryHelper.RegEntryExists(FwRegistryHelper.FieldWorksRegistryKey, null, "ProjectShared", out dummy));
            }
        }