public void ThrowArgumentNull_If_Source_Is_Empty() { Task.Run(() => { Assert.ThrowsException <ArgumentNullException>(async() => await _copier.CopyAsync(_source, _destination)); }); }
private async void btnStartCopy_Click(object sender, EventArgs e) { _DisableButtons(); copyProgressBar.Style = ProgressBarStyle.Marquee; try { _logger.Info($"Copying from source: {txtSourcePath.Text} :: destination: {txtDestinationPath.Text}"); await _copierInstance.CopyAsync(txtSourcePath.Text, txtDestinationPath.Text); _logger.Info($"Completed"); MessageBox.Show(this, "Completed!", "CopyDirectory", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { _logger.Debug(ex); MessageBox.Show(this, ex.Message, "CopyDirectory", MessageBoxButtons.OK, MessageBoxIcon.Error); } copyProgressBar.Style = ProgressBarStyle.Continuous; _EnableButtons(); }