public override Task UploadAsync(TransferSpec spec) { spec.Progress.Tries++; ConfirmSchemeSupported(spec.Uri.Scheme); return (_fileCopy.CopyFileAsync(spec.LocalFile, GetPathFromUri(spec))); }
public void CanÙploadLocalFileAsync() { Strategy.UploadAsync(new FileUploadSpec("C:/d", "file://c:/a/d")); A.CallTo(() => _fileCopy.CopyFileAsync("c:/d".ToAbsoluteFilePath(), "c:/a/d".ToAbsoluteFilePath())) .MustHaveHappened(Repeated.Exactly.Once); }
public override async Task DownloadAsync(TransferSpec spec) { spec.Progress.Tries++; ConfirmSchemeSupported(spec.Uri.Scheme); await _fileCopy.CopyFileAsync(GetPathFromUri(spec), spec.LocalFile).ConfigureAwait(false); VerifyIfNeeded(spec, spec.LocalFile); }