Beispiel #1
0
        public void DownloadPackage()
        {
            var downloadResourceResult = _nugetHelper.DownloadPackageAsync(TestPackageName, true, true).Result;
            var tempLocation           = Directory.CreateDirectory("Temp\\DownloadedMod");

            NugetHelper.ExtractPackageContent(downloadResourceResult, tempLocation.FullName);

            // Check ModConfig.json exists.
            string modConfigLocation = $"{tempLocation.FullName}\\ModConfig.json";

            Assert.True(File.Exists(modConfigLocation));

            Directory.Delete(tempLocation.FullName, true);
        }
Beispiel #2
0
 public async Task ExtractPackageAsync(string sourceFilePath, string destDirPath, IProgress <double> progress = null,
                                       CancellationToken cancellationToken = new CancellationToken())
 {
     await Task.Run(() => NugetHelper.ExtractPackageContent(sourceFilePath, destDirPath, cancellationToken), cancellationToken);
 }