本文整理汇总了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);
}
示例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);
}
示例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");
}
示例4: Because
public override void Because()
{
Results = Service.upgrade_run(Configuration);
_packageResult = Results.FirstOrDefault().Value;
}
示例5: Because
public override void Because()
{
MockLogger.LogMessagesToConsole = true;
Results = Service.uninstall_run(Configuration);
_packageResult = Results.FirstOrDefault().Value;
}