public void Unregister() { DummyImportRegistryTask task = new DummyImportRegistryTask(); task.RegistryFile = m_RegFileName; task.Unregister = true; task.PerUser = true; task.DoIt(); Assert.IsNull(Registry.CurrentUser.OpenSubKey(@"Software\Classes\FwTasksTests")); }
public void Import() { DummyImportRegistryTask task = new DummyImportRegistryTask(); task.RegistryFile = m_RegFileName; task.Unregister = false; task.PerUser = true; task.DoIt(); RegistryKey testKey = Registry.CurrentUser.OpenSubKey(@"Software\Classes\FwTasksTests"); Assert.AreEqual("ImportRegistry", testKey.GetValue(null)); RegistryKey subKey = testKey.OpenSubKey("Subkey\\Test"); Assert.AreEqual("bla", subKey.GetValue("bla")); }
public void Unsupported_DWORD() { string regFilename = Path.GetTempFileName(); File.WriteAllText(regFilename, @"REGEDIT4 [HKEY_CLASSES_ROOT\FwTasksTests\Unsupported] ""dword32""=dword:00000032"); try { DummyImportRegistryTask task = new DummyImportRegistryTask(); task.RegistryFile = regFilename; task.Unregister = false; task.PerUser = true; task.DoIt(); } finally { File.Delete(regFilename); } }
public void Unsupported_Binary() { string regFilename = Path.GetTempFileName(); File.WriteAllText(regFilename, @"REGEDIT4 [HKEY_CLASSES_ROOT\FwTasksTests\Unsupported] ""bla""=hex:00,01,02,03,04,05,06,07"); try { DummyImportRegistryTask task = new DummyImportRegistryTask(); task.RegistryFile = regFilename; task.Unregister = false; task.PerUser = true; task.DoIt(); } finally { File.Delete(regFilename); } }