コード例 #1
0
        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"));
        }
コード例 #2
0
        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"));
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
		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"));
		}
コード例 #6
0
		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);
			}
		}
コード例 #7
0
		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);
			}
		}
コード例 #8
0
		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"));
		}