public void FriendlyName() { RegistryHive hive = RegistryHive.Create(new MemoryStream()); Store s = Store.Initialize(hive.Root); BcdObject obj = s.CreateInherit(InheritType.AnyObject); Element el = obj.AddElement(WellKnownElement.LibraryApplicationPath, ElementValue.ForString(@"a\path\to\nowhere")); Assert.Equal("{path}", el.FriendlyName); }
public void RemoveElement() { RegistryHive hive = RegistryHive.Create(new MemoryStream()); Store s = Store.Initialize(hive.Root); BcdObject obj = s.CreateInherit(InheritType.AnyObject); obj.AddElement(WellKnownElement.LibraryApplicationPath, ElementValue.ForString(@"\a\path\to\nowhere")); obj.RemoveElement(WellKnownElement.LibraryApplicationPath); Assert.False(obj.HasElement(WellKnownElement.LibraryApplicationPath)); }
public void AddElement_WrongType() { RegistryHive hive = RegistryHive.Create(new MemoryStream()); Store s = Store.Initialize(hive.Root); BcdObject obj = s.CreateInherit(InheritType.AnyObject); Assert.Throws <ArgumentException>(() => obj.AddElement(WellKnownElement.LibraryApplicationDevice, ElementValue.ForString(@"\a\path\to\nowhere"))); }