public async Task WhenPackageExists_ThenSaveLocally() { var fileName = NugetPackageFileName.Create(ExistingPackageId, ExistingPackageVersion); var filePath = Path.Combine(BasePath, fileName); await _sut.DownloadToFileAsync(ExistingPackageId, ExistingPackageVersion, filePath); AssertFile.Exists(filePath); AssertFile.SizeGreaterThan(filePath, 0); }
public async Task WhenFileAlreadyExists_ThenOverWrite() { var fileName = NugetPackageFileName.Create(ExistingPackageId, ExistingPackageVersion); var filePath = Path.Combine(BasePath, fileName); TextFileTestBuilder.InFileSystem.WithSize(1).WithFilePath(filePath).Build(); await _sut.DownloadToFileAsync(ExistingPackageId, ExistingPackageVersion, filePath); AssertFile.SizeGreaterThan(filePath, 1); }