Пример #1
0
            public override void Context()
            {
                Configuration = Scenario.list();
                Scenario.reset(Configuration);
                Scenario.add_packages_to_source_location(Configuration, Configuration.Input + "*" + Constants.PackageExtension);
                Scenario.add_packages_to_source_location(Configuration, "installpackage*" + Constants.PackageExtension);
                Scenario.install_package(Configuration, "installpackage", "1.0.0");
                Scenario.install_package(Configuration, "upgradepackage", "1.0.0");

                Service = NUnitSetup.Container.GetInstance<IChocolateyPackageService>();
            }
Пример #2
0
            public override void Context()
            {
                Configuration = Scenario.install();
                Scenario.reset(Configuration);
                Configuration.PackageNames = Configuration.Input = "installpackage";
                Scenario.add_packages_to_source_location(Configuration, Configuration.Input + "*" + Constants.PackageExtension);
                Scenario.add_packages_to_source_location(Configuration, "badpackage.1*" + Constants.PackageExtension);

                Service = NUnitSetup.Container.GetInstance<IChocolateyPackageService>();

                CommandExecutor = new CommandExecutor(NUnitSetup.Container.GetInstance<IFileSystem>());
            }
Пример #3
0
            public override void Context()
            {
                Configuration = Scenario.upgrade();
                Scenario.reset(Configuration);
                Configuration.PackageNames = Configuration.Input = "upgradepackage";
                Scenario.add_packages_to_source_location(Configuration, Configuration.Input + "*" + Constants.PackageExtension);
                Scenario.add_packages_to_source_location(Configuration, "installpackage*" + Constants.PackageExtension);
                Scenario.add_packages_to_source_location(Configuration, "badpackage*" + Constants.PackageExtension);
                Scenario.install_package(Configuration, "installpackage", "1.0.0");
                Scenario.install_package(Configuration, "upgradepackage", "1.0.0");
                Configuration.SkipPackageInstallProvider = true;
                Scenario.install_package(Configuration, "badpackage", "1.0");
                Configuration.SkipPackageInstallProvider = false;

                Service = NUnitSetup.Container.GetInstance<IChocolateyPackageService>();
            }
        public LocalSourceControlViewModel(
            IChocolateyPackageService chocolateyService,
            IProgressService progressService,
            IPersistenceService persistenceService,
            Func<Type, ILogService> logFactory)
        {
            if (logFactory == null)
            {
                throw new ArgumentNullException("logFactory");
            }

            this._chocolateyService = chocolateyService;
            this._progressService = progressService;
            this._persistenceService = persistenceService;
            this._logService = logFactory(typeof(LocalSourceControlViewModel));
            PackagesChangedEventManager.AddListener(this._chocolateyService, this);

            this.Packages = new ObservableCollection<IPackageViewModel>();
            this._packages = new List<IPackageViewModel>();
        }
Пример #5
0
        public static void install_package(ChocolateyConfiguration config, string packageId, string version)
        {
            if (_service == null)
            {
                _service= NUnitSetup.Container.GetInstance<IChocolateyPackageService>();
            }

            var originalPackageName = config.PackageNames;
            var originalPackageVersion = config.Version;

            config.PackageNames = packageId;
            config.Version = version;
            _service.install_run(config);
            config.PackageNames = originalPackageName;
            config.Version = originalPackageVersion;
            //var pattern = "{0}.{1}{2}".format_with(packageId, string.IsNullOrWhiteSpace(version) ? "*" : version, Constants.PackageExtension);
            //var files = _fileSystem.get_files(config.Sources, pattern);
            //foreach (var file in files)
            //{
            //    var packageManager = NugetCommon.GetPackageManager(config, new ChocolateyNugetLogger(), null, null, false);
            //    packageManager.InstallPackage(new OptimizedZipPackage(file), false,false);
            //}
        }
Пример #6
0
 public ChocolateyUpgradeCommand(IChocolateyPackageService packageService)
 {
     _packageService = packageService;
 }
Пример #7
0
        //todo: v1 Deprecation - remove version

        public ChocolateyVersionCommand(IChocolateyPackageService packageService)
            : base(packageService)
        {
            _packageService = packageService;
        }
Пример #8
0
 public ChocolateyPushCommand(IChocolateyPackageService packageService, IChocolateyConfigSettingsService configSettingsService)
 {
     _packageService        = packageService;
     _configSettingsService = configSettingsService;
 }
Пример #9
0
 public ChocolateyInfoCommand(IChocolateyPackageService packageService)
     : base(packageService)
 {
 }
Пример #10
0
 public static void install_package(ChocolateyConfiguration config, string packageId, string version)
 {
     if (_service == null)
     {
         _service = NUnitSetup.Container.GetInstance<IChocolateyPackageService>();
     }
     var installConfig = config.deep_copy();
   
     installConfig.PackageNames = packageId;
     installConfig.Version = version;
     _service.install_run(installConfig);
   
     NUnitSetup.MockLogger.Messages.Clear();
 }
Пример #11
0
 public ChocolateyPushCommand(IChocolateyPackageService packageService, IChocolateyConfigSettingsService configSettingsService)
 {
     _packageService = packageService;
     _configSettingsService = configSettingsService;
 }
Пример #12
0
 public ChocolateyListCommand(IChocolateyPackageService packageService)
 {
     _packageService = packageService;
 }
Пример #13
0
 public ChocolateyUpgradeCommand(IChocolateyPackageService packageService)
 {
     _packageService = packageService;
 }
Пример #14
0
 public ChocolateyOutdatedCommand(IChocolateyPackageService packageService)
 {
     _packageService = packageService;
 }
Пример #15
0
 public ChocolateyInfoCommand(IChocolateyPackageService packageService)
     : base(packageService)
 {
 }
Пример #16
0
        //todo: v1 Deprecation - remove version

        public ChocolateyVersionCommand(IChocolateyPackageService packageService)
            : base(packageService)
        {
            _packageService = packageService;
        }
 public static void RemoveListener(IChocolateyPackageService service, IWeakEventListener listener)
 {
     CurrentManager.ProtectedRemoveListener(service, listener);
 }
 //todo: v1 Deprecation - update is removed or becomes package indexes
 public ChocolateyUpdateCommand(IChocolateyPackageService packageService) : base(packageService)
 {
 }
 public ChocolateyOutdatedCommand(IChocolateyPackageService packageService)
 {
     _packageService = packageService;
 }
Пример #20
0
 //todo: v1 Deprecation - update is removed or becomes package indexes
 public ChocolateyUpdateCommand(IChocolateyPackageService packageService) : base(packageService)
 {
 }
Пример #21
0
 public LogTesting()
 {
     Service = chocolatey.tests.integration.NUnitSetup.Container.GetInstance <IChocolateyPackageService>();
 }
Пример #22
0
 public ChocolateyInstallCommand(IChocolateyPackageService packageService)
 {
     _packageService = packageService;
 }
Пример #23
0
 public ChocolateyListCommand(IChocolateyPackageService packageService)
 {
     _packageService = packageService;
 }
Пример #24
0
 public ChocolateyInstallCommand(IChocolateyPackageService packageService)
 {
     _packageService = packageService;
 }
Пример #25
0
 public ChocolateyDescribeCommand(IChocolateyPackageService packageService)
     : base(packageService)
 {
     _packageService = packageService;
 }
 public static IPackageViewModel GetLatest(string id, IChocolateyPackageService chocolateyService, Func<IPackageViewModel> packageFactory, Uri source, bool includePrerelease = false)
 {
     throw new NotImplementedException();
 }
        public PackageViewModel(IPackageService packageService, IChocolateyPackageService chocolateyService, INavigationService navigationService)
        {
            this._packageService = packageService;
            this._chocolateyService = chocolateyService;
            this._navigationService = navigationService;
            PackagesChangedEventManager.AddListener(this._chocolateyService, this);

            this._isInstalled = new Lazy<bool>(() => this._chocolateyService.IsPackageInstalled(this.Id, this.Version));
        }
Пример #28
0
 public static void RemoveListener(IChocolateyPackageService service, IWeakEventListener listener)
 {
     CurrentManager.ProtectedRemoveListener(service, listener);
 }