public void SetValueData_WithoutValueNameInPath() { var TestValueData = "Test Value Data"; AdvRegistry.SetValueData(ExistentKeyPath, TestValueData); Assert.AreEqual(TestValueData, AdvRegistry.GetValueData(ExistentKeyPath)); }
public void SetValueData_ExistentKeyNonexitentVal() { var TestValueData = "Test Value Data"; AdvRegistry.SetValueData(ExistentKey_NonexistentVal_Path, TestValueData); Assert.AreEqual(TestValueData, AdvRegistry.GetValueData(ExistentKey_NonexistentVal_Path)); }
private static int Benchmark(Ruleset ruleset, int benchmarkTime) { int accessCounter = 0; var time = DateTime.Now.AddMinutes(benchmarkTime); while (DateTime.Now < time) { foreach (Ruleset.PathsRow path in ruleset.Paths) { // Try to open every file in list. foreach (var fsPath in ExpandFSPaths(path)) { FileStream file = null; try { if (File.Exists(fsPath)) { file = File.Open(fsPath, FileMode.Open, FileAccess.Read); } } catch { } finally { if (file != null) { file.Close(); } } } if (AdvRegistry.IsRegistryPath(path.Path) && AdvRegistry.IsKeyExists(path.Path)) { AdvRegistry.GetValueData(path.Path); } } accessCounter++; Console.Write("."); } Console.WriteLine(); return(accessCounter); }
public void Initialize() { var Key = Registry.CurrentUser.CreateSubKey("existent"); if (Key == null) { throw new ApplicationException("Can't create existent key in HKCU."); } Key.SetValue("existent", "TEST"); if (Registry.CurrentUser.OpenSubKey("nonexistent") != null) { throw new ApplicationException("nonexistent key exists in HKCU."); } if (AdvRegistry.GetValueData(ExistentKey_NonexistentVal_Path) != null) { throw new ApplicationException("nonexistent val exists in HKCU\\existent."); } }
public void SetValueData_EmptyData() { AdvRegistry.SetValueData(ExistentValPath, ""); Assert.AreEqual(string.Empty, AdvRegistry.GetValueData(ExistentValPath)); }
public void GetValueData() { Assert.AreEqual("TEST", AdvRegistry.GetValueData(ExistentValPath)); }