public async Task DoAFileCopy() { CreateTestFile(); var result = await FileWithProgress.CopyAsync(TestFilePath, TestDestinationPath, ProgressUpdater); Assert.IsTrue(result); Assert.IsTrue(File.Exists(TestDestinationPath)); Assert.IsTrue(File.Exists(TestFilePath)); }
internal async Task <bool> CopyAsync(string sourcePath, string destinationPath, Action <decimal> updateProgressBar) { this.IsCancelled = false; this.UpdateProgressAsPct = updateProgressBar; try { _isMoving = true; return(await FileWithProgress.CopyAsync(sourcePath, destinationPath, ProgressCallback, this)); } finally { _isMoving = false; } }