public void BadSettingPUT204()
 {
     using (PexDisposableContext disposables = PexDisposableContext.Create())
     {
       SettingsGroup settingsGroup;
       RegistrySettingsStorage s0 = new RegistrySettingsStorage((RegistryKey)null);
       settingsGroup = new SettingsGroup((ISettingsStorage)s0);
       disposables.Add((IDisposable)settingsGroup);
       this.BadSettingPUT2(settingsGroup, "\0", "\0", false);
       disposables.Dispose();
     }
 }
 public void SubGroupSettingsPUT203()
 {
     using (PexDisposableContext disposables = PexDisposableContext.Create())
     {
       SettingsGroup settingsGroup;
       RegistrySettingsStorage s0 = new RegistrySettingsStorage(Registry.DynData);
       settingsGroup = new SettingsGroup((ISettingsStorage)s0);
       disposables.Add((IDisposable)settingsGroup);
       object s1 = new object();
       this.SubGroupSettingsPUT2(settingsGroup, "", s1);
       disposables.Dispose();
     }
 }
 public void TopLevelSettingsPUT104()
 {
     using (PexDisposableContext disposables = PexDisposableContext.Create())
     {
       SettingsGroup settingsGroup;
       RegistrySettingsStorage s0 = new RegistrySettingsStorage((RegistryKey)null);
       settingsGroup = new SettingsGroup((ISettingsStorage)s0);
       disposables.Add((IDisposable)settingsGroup);
       object s1 = new object();
       this.TopLevelSettingsPUT1(settingsGroup, "\0", s1);
       disposables.Dispose();
     }
 }
        void ConvertLegacySettings()
        {
            RegistryKey key = Registry.CurrentUser.OpenSubKey( NUnitRegistry.KEY );
            if ( key == null )
                key = Registry.CurrentUser.OpenSubKey( NUnitRegistry.LEGACY_KEY );

            if ( key != null )
            {
                using( ISettingsStorage legacyStorage = new RegistrySettingsStorage( key ) )
                {
                    new LegacySettingsConverter( legacyStorage, storage ).Convert();
                }

                storage.SaveSettings();
            }
        }
        void ConvertLegacySettings()
        {
            RegistryKey key = Registry.CurrentUser.OpenSubKey(NUnitRegistry.KEY);

            if (key == null)
            {
                key = Registry.CurrentUser.OpenSubKey(NUnitRegistry.LEGACY_KEY);
            }

            if (key != null)
            {
                using (ISettingsStorage legacyStorage = new RegistrySettingsStorage(key))
                {
                    new LegacySettingsConverter(legacyStorage, storage).Convert();
                }

                storage.SaveSettings();
            }
        }
		/// <summary>
		/// Construct a storage as a child of another storage
		/// </summary>
		/// <param name="storageName">The name to give the storage</param>
		/// <param name="parentStorage">The parent in which the storage is to be created</param>
		public RegistrySettingsStorage( string storageName, RegistrySettingsStorage parentStorage ) 
			: base( storageName, parentStorage ) 
		{ 
			this.storageKey = parentStorage.StorageKey.CreateSubKey( storageName );
		}
 public void SubGroupSettingsPUT214()
 {
     using (PexDisposableContext disposables = PexDisposableContext.Create())
     {
       MemorySettingsStorage memorySettingsStorage;
       SettingsGroup settingsGroup;
       string[] ss = new string[1];
       object[] os = new object[1];
       ss[0] = "";
       object boxi = (object)(default(int));
       os[0] = boxi;
       memorySettingsStorage = MemorySettingsStorageFactory.Create(ss, os);
       disposables.Add((IDisposable)memorySettingsStorage);
       settingsGroup = new SettingsGroup((ISettingsStorage)memorySettingsStorage);
       disposables.Add((IDisposable)settingsGroup);
       RegistrySettingsStorage s0 = new RegistrySettingsStorage((RegistryKey)null);
       this.SubGroupSettingsPUT2(settingsGroup, "", (object)s0);
       disposables.Dispose();
       PexAssert.IsNotNull((object)settingsGroup);
       PexAssert.IsNull(settingsGroup.Storage);
     }
 }
 public void BadSettingPUT124()
 {
     using (PexDisposableContext disposables = PexDisposableContext.Create())
     {
       SettingsGroup settingsGroup;
       RegistrySettingsStorage s0 = new RegistrySettingsStorage(Registry.DynData);
       settingsGroup = new SettingsGroup((ISettingsStorage)s0);
       disposables.Add((IDisposable)settingsGroup);
       this.BadSettingPUT1(settingsGroup, "\\\\.", "J\n3\u0080\u0004@\u001a", 0);
       disposables.Dispose();
     }
 }
 public void BadSettingPUT117()
 {
     using (PexDisposableContext disposables = PexDisposableContext.Create())
     {
       SettingsGroup settingsGroup;
       RegistrySettingsStorage s0 = new RegistrySettingsStorage((RegistryKey)null);
       settingsGroup = new SettingsGroup((ISettingsStorage)s0);
       disposables.Add((IDisposable)settingsGroup);
       this.BadSettingPUT1(settingsGroup, "\0.", "V\u0005\'\u00800@\0", 0);
       disposables.Dispose();
     }
 }
 public void BadSettingPUT114()
 {
     using (PexDisposableContext disposables = PexDisposableContext.Create())
     {
       SettingsGroup settingsGroup;
       RegistrySettingsStorage s0 = new RegistrySettingsStorage(Registry.DynData);
       settingsGroup = new SettingsGroup((ISettingsStorage)s0);
       disposables.Add((IDisposable)settingsGroup);
       this.BadSettingPUT1(settingsGroup, "", "(}K\u0100\u0001@\0", 0);
       disposables.Dispose();
     }
 }
Esempio n. 11
0
 /// <summary>
 /// Construct a storage as a child of another storage
 /// </summary>
 /// <param name="storageName">The name to give the storage</param>
 /// <param name="parentStorage">The parent in which the storage is to be created</param>
 public RegistrySettingsStorage(string storageName, RegistrySettingsStorage parentStorage)
     : base(storageName, parentStorage)
 {
     this.storageKey = parentStorage.StorageKey.CreateSubKey(storageName);
 }
 public void BadSettingPUT213()
 {
     using (PexDisposableContext disposables = PexDisposableContext.Create())
     {
       SettingsGroup settingsGroup;
       RegistrySettingsStorage s0 = new RegistrySettingsStorage(Registry.DynData);
       settingsGroup = new SettingsGroup((ISettingsStorage)s0);
       disposables.Add((IDisposable)settingsGroup);
       this.BadSettingPUT2(settingsGroup, "\\\\.", "..", false);
       disposables.Dispose();
     }
 }