public async Task ItThrowsIfDestinationPathIsNull() { ProductRelease release = GetProductRelease("2.1", "2.1.8"); ReleaseFile file = release.Files.FirstOrDefault(); Func <Task> f = async() => await file.DownloadAsync(null); ArgumentNullException exception = await Assert.ThrowsAsync <ArgumentNullException>(f); }
public async Task ItThrowsIfDestinationPathIsEmpty() { ProductRelease release = GetProductRelease("2.1", "2.1.8"); ReleaseFile file = release.Files.FirstOrDefault(); Func <Task> f = async() => await file.DownloadAsync(""); ArgumentException exception = await Assert.ThrowsAsync <ArgumentException>(f); Assert.Equal($"Value cannot be empty.{Environment.NewLine}Parameter name: destinationPath", exception.Message); }