当前位置: 首页>>代码示例>>C#>>正文


C# results.PackageResult类代码示例

本文整理汇总了C#中chocolatey.infrastructure.results.PackageResult的典型用法代码示例。如果您正苦于以下问题:C# PackageResult类的具体用法?C# PackageResult怎么用?C# PackageResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PackageResult类属于chocolatey.infrastructure.results命名空间,在下文中一共展示了PackageResult类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Context

            public override void Context()
            {
                CommandExecutor.initialize_with(new Lazy<IFileSystem>(() => fileSystem.Object), () => process.Object);

                service = new AutomaticUninstallerService(packageInfoService.Object, fileSystem.Object, registryService.Object, commandExecutor.Object);
                service.WaitForCleanup = false;
                config.Features.AutoUninstaller = true;
                config.PromptForConfirmation = false;
                package.Setup(p => p.Id).Returns("regular");
                package.Setup(p => p.Version).Returns(new SemanticVersion("1.2.0"));
                packageResult = new PackageResult(package.Object, null);
                packageInformation = new ChocolateyPackageInformation(package.Object);
                registryKeys.Add(new RegistryApplicationKey
                    {
                        InstallLocation = @"C:\Program Files (x86)\WinDirStat",
                        UninstallString = originalUninstallString,
                        HasQuietUninstall = true,
                        KeyPath = @"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinDirStat",
                        InstallerType = installerType.InstallerType,
                    });
                packageInformation.RegistrySnapshot = new Registry("123", registryKeys);
                packageInfoService.Setup(s => s.get_package_information(package.Object)).Returns(packageInformation);
                packageResults.GetOrAdd("regular", packageResult);

                fileSystem.Setup(f => f.directory_exists(registryKeys.FirstOrDefault().InstallLocation)).Returns(true);
                registryService.Setup(r => r.installer_value_exists(registryKeys.FirstOrDefault().KeyPath, ApplicationParameters.RegistryValueInstallLocation)).Returns(true);
                fileSystem.Setup(f => f.get_full_path(expectedUninstallString)).Returns(expectedUninstallString);
            }
开发者ID:secretGeek,项目名称:choco,代码行数:28,代码来源:AutomaticUninstallerServiceSpecs.cs

示例2: Context

            public override void Context()
            {
                base.Context();
                _contextPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "infrastructure", "filesystem");
                _theLockedFile = Path.Combine(_contextPath, "Slipsum.txt");
                _packageResult = new PackageResult("bob", "1.2.3", FileSystem.get_directory_name(_theLockedFile));

                _fileStream = new FileStream(_theLockedFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
            }
开发者ID:dekalinowski,项目名称:choco,代码行数:9,代码来源:FilesServiceSpecs.cs

示例3: Context

 public override void Context()
 {
     base.Context();
     packageResult = new PackageResult("bob", "1.2.3", installDirectory);
  
     FileSystem.Setup(x => x.get_files(ApplicationParameters.PackagesLocation + "\\bob", It.IsAny<string>(), SearchOption.AllDirectories)).Returns(files);
     HashProvider.Setup(x => x.hash_file(It.IsAny<string>())).Returns("yes");
 }
开发者ID:shrknt35,项目名称:sonarlint-vs,代码行数:8,代码来源:FilesServiceSpecs.cs

示例4: Because

 public override void Because()
 {
     Results = Service.upgrade_run(Configuration);
     _packageResult = Results.FirstOrDefault().Value;
 }
开发者ID:gregsdennis,项目名称:choco,代码行数:5,代码来源:UpgradeScenarios.cs

示例5: Because

 public override void Because()
 {
     MockLogger.LogMessagesToConsole = true;
     Results = Service.uninstall_run(Configuration);
     _packageResult = Results.FirstOrDefault().Value;
 }
开发者ID:rhillaardvark,项目名称:choco,代码行数:6,代码来源:UninstallScenarios.cs


注:本文中的chocolatey.infrastructure.results.PackageResult类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。