public RegDbTests()
 {
   _entryValue = new VirtualRegistryValue("myValue", new ASCIIEncoding().GetBytes("someData"), ValueType.REG_SZ);
   _entryKey = new VirtualRegistryKey(456, @"HKEY_USERS\MyTestUser\TestEntry",
                                     new Dictionary<string, VirtualRegistryValue> { { _entryValue.Name, _entryValue } });
 }
 public void UpdateItemsKey()
 {
   var db = RegistryDatabase.CreateDefaultDatabase(DbConstants.DatabaseFile);
   db.Initialize();
   _entryKey = new VirtualRegistryKey(_entryKey.Handle,
                                     @"HKEY_USERS\MyTestUser\UpdatedTestEntry",
                                     _entryKey.Values);
   db.EnqueueAction(new DatabaseAction<VirtualRegistryKey>(_entryKey, DatabaseActionType.Set));
   Thread.Sleep(500);  // Give the database some time to write
   var items = db.ReadAll();
   var rEntry = items.First();
   Assert.IsTrue(rEntry.Path == _entryKey.Path,
     "Inputted path is \"" + _entryKey.Path + "\"  while outputted path is \"" + rEntry.Path + "\"");
 }