コード例 #1
0
        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.");
            }
        }
コード例 #2
0
        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.");
        }
コード例 #3
0
        public void UninstallPackage([NotNull] string fastPackageReference)
        {
            var requirements = ParseReference(fastPackageReference);

            using (var integrationManager = new IntegrationManager(Handler, _machineWide))
                integrationManager.RemoveApp(integrationManager.AppList[requirements.InterfaceUri]);
        }
コード例 #4
0
        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]);
        }