public void CreateDevice() { RegistryHive hive = RegistryHive.Create(new MemoryStream()); Store s = Store.Initialize(hive.Root); BcdObject obj = s.CreateDevice(); Assert.AreNotEqual(Guid.Empty, obj.Identity); Assert.AreEqual(ObjectType.Device, obj.ObjectType); BcdObject reGet = s.GetObject(obj.Identity); Assert.AreEqual(obj.Identity, reGet.Identity); }
public void CreateApplication() { RegistryHive hive = RegistryHive.Create(new MemoryStream()); Store s = Store.Initialize(hive.Root); BcdObject obj = s.CreateApplication(ApplicationImageType.WindowsBoot, ApplicationType.BootManager); Assert.AreNotEqual(Guid.Empty, obj.Identity); Assert.AreEqual(ObjectType.Application, obj.ObjectType); BcdObject reGet = s.GetObject(obj.Identity); Assert.AreEqual(obj.Identity, reGet.Identity); }
public void CreateInherit() { RegistryHive hive = RegistryHive.Create(new MemoryStream()); Store s = Store.Initialize(hive.Root); BcdObject obj = s.CreateInherit(InheritType.ApplicationObjects); Assert.AreNotEqual(Guid.Empty, obj.Identity); Assert.AreEqual(ObjectType.Inherit, obj.ObjectType); Assert.IsTrue(obj.IsInheritableBy(ObjectType.Application)); Assert.IsFalse(obj.IsInheritableBy(ObjectType.Device)); BcdObject reGet = s.GetObject(obj.Identity); Assert.AreEqual(obj.Identity, reGet.Identity); }