private async Task DownloadReloadedAsync(string downloadLocation, IProgress <double> downloadProgress) { CurrentStepDescription = "Downloading Reloaded II"; var resolver = new GithubPackageResolver("Reloaded-Project", "Reloaded-II", "Release.zip"); var versions = await resolver.GetPackageVersionsAsync(); var latestVersion = versions.First(); await resolver.DownloadPackageAsync(latestVersion, downloadLocation, downloadProgress, CancellationToken.Token); if (!File.Exists(downloadLocation)) { throw new Exception($"Reloaded failed to download (no file was written to disk)."); } }
public async Task GithubPackageResolver_GetPackageVersionsAsync_Test() { // Arrange var expectedVersions = new[] { Version.Parse("1.0"), Version.Parse("2.0"), Version.Parse("3.0") }; // Act var resolver = new GithubPackageResolver("Tyrrrz", "OnovaTestRepo", "*.onv"); var versions = await resolver.GetPackageVersionsAsync(); // Assert Assert.That(versions, Is.Not.Null); Assert.That(versions, Is.EquivalentTo(expectedVersions)); }