• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# results.PackageResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# lang.MapEntry类代码示例发布时间:2022-05-26
下一篇:
C# byps.BOutput类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap