public void TestRemoveApp() { var target = new FeedTarget(FeedTest.Test1Uri, new Feed { Name = "Test" }); var appEntry = _integrationManager.AddApp(target); // Inject access point into AppEntry (without running integration) using (var unapplyFlag = new TemporaryFlagFile("0install-unit-tests")) { appEntry.AccessPoints = new AccessPointList { Entries = { new MockAccessPoint { UnapplyFlagPath = unapplyFlag } } }; _integrationManager.RemoveApp(appEntry); Assert.IsEmpty(_integrationManager.AppList.Entries); Assert.IsTrue(unapplyFlag.Set, "Access points should be unapplied when their AppEntry is removed"); Assert.DoesNotThrow(() => _integrationManager.RemoveApp(appEntry), "Allow multiple removals of applications."); } }
public void TestRemoveApp() { var target = new FeedTarget(FeedTest.Test1Uri, new Feed { Name = "Test" }); var appEntry = _integrationManager.AddApp(target); // Inject access point into AppEntry (without running integration) using var unapplyFlag = new TemporaryFlagFile("0install-unit-tests"); appEntry.AccessPoints = new AccessPointList { Entries = { new MockAccessPoint { UnapplyFlagPath = unapplyFlag } } }; _integrationManager.RemoveApp(appEntry); _integrationManager.AppList.Entries.Should().BeEmpty(); unapplyFlag.Set.Should().BeTrue(because: "Access points should be unapplied when their AppEntry is removed"); _integrationManager.Invoking(x => x.RemoveApp(appEntry)) .Should().NotThrow(because: "Allow multiple removals of applications."); }
public void UninstallPackage([NotNull] string fastPackageReference) { var requirements = ParseReference(fastPackageReference); using (var integrationManager = new IntegrationManager(Handler, _machineWide)) integrationManager.RemoveApp(integrationManager.AppList[requirements.InterfaceUri]); }
public void UninstallPackage(string fastPackageReference) { if (MachineWide && !WindowsUtils.IsAdministrator) throw new NotAdminException(Resources.MustBeAdminForMachineWide); var requirements = ParseReference(fastPackageReference); using (var integrationManager = new IntegrationManager(Handler, MachineWide)) integrationManager.RemoveApp(integrationManager.AppList[requirements.InterfaceUri]); }