public void TestSnapPackageManagerRestoreSummary(SnapPackageManagerRestoreType restoreType) { var restoreSummary = new SnapPackageManagerRestoreSummary(restoreType); Assert.Equal(restoreType, restoreSummary.RestoreType); Assert.Empty(restoreSummary.ChecksumSummary); Assert.Empty(restoreSummary.DownloadSummary); Assert.Empty(restoreSummary.ReassembleSummary); Assert.False(restoreSummary.Success); }
public async Task TestRestoreAsync_SnapAppReleases_Empty(SnapPackageManagerRestoreType restoreType) { var genesisSnapApp = _baseFixturePackaging.BuildSnapApp(); var snapAppChannel = genesisSnapApp.GetDefaultChannelOrThrow(); await using var restoreDirectory = new DisposableDirectory(_baseFixturePackaging.WorkingDirectory, _snapFilesystem); await using var nugetPackageSourcesDirectory = _snapFilesystem.WithDisposableTempDirectory(_baseFixturePackaging.WorkingDirectory); var packagesDirectory = _snapFilesystem.PathCombine(restoreDirectory.WorkingDirectory, "packages"); var nugetPackageSources = genesisSnapApp.BuildNugetSources(nugetPackageSourcesDirectory.WorkingDirectory); var packageSource = nugetPackageSources.Items.Single(); var snapAppChannelReleases = new SnapAppChannelReleases(genesisSnapApp, snapAppChannel, Enumerable.Empty <SnapRelease>()); var restoreSummary = await _snapPackageManager.RestoreAsync(packagesDirectory, snapAppChannelReleases, packageSource, restoreType); Assert.Empty(restoreSummary.ChecksumSummary); Assert.Empty(restoreSummary.DownloadSummary); Assert.Empty(restoreSummary.ReassembleSummary); Assert.Equal(restoreType, restoreSummary.RestoreType); Assert.True(restoreSummary.Success); }