Beispiel #1
0
        public void DeleteKey_ForExistentKeyWithSubkeys()
        {
            AdvRegistry.CreateKey(ExistentKeyPath + "\\Subkey1");
            AdvRegistry.CreateKey(ExistentKeyPath + "\\Subkey2");

            AdvRegistry.DeleteKey(ExistentKeyPath);
            Assert.IsFalse(AdvRegistry.IsKeyExists(ExistentKeyPath));
        }
Beispiel #2
0
        public void CreateKey()
        {
            if (Registry.CurrentUser.OpenSubKey("TestKey") != null)
            {
                Assert.Fail(@"HKCU\TestKey already exists.");
            }

            AdvRegistry.CreateKey(@"HKCU\TestKey");

            if (Registry.CurrentUser.OpenSubKey("TestKey") == null)
            {
                Assert.Fail(@"HKCU\TestKey failed to create.");
            }
            else
            {
                Registry.CurrentUser.DeleteSubKey("TestKey");
            }
        }