public void TestPathless() { // act Action act = () => DownloadBuilder.New().WithUrl(url).Build(); // assert Assert.ThrowsException <ArgumentNullException>(act); }
public void TestUrlless() { // act Action act = () => DownloadBuilder.New().WithFileLocation(path).Build(); // assert Assert.ThrowsException <ArgumentNullException>(act); }
public void TestSetName() { // act IDownload download = DownloadBuilder.New() .WithUrl(url) .WithFileLocation(path) .WithFileName(filename) .Build(); // assert Assert.AreEqual(folder, download.Folder); Assert.AreEqual(filename, download.Filename); }
public void TestSetFolderAndName() { // act IDownload download = DownloadBuilder.New() .WithUrl(url) .WithDirectory(folder) .WithFileName(filename) .Build(); // assert Assert.AreEqual(folder, download.Folder); Assert.AreEqual(filename, download.Filename); }
public void TestSetFolder() { // arrange var dir = Path.GetTempPath(); // act IDownload download = DownloadBuilder.New() .WithUrl(url) .WithDirectory(dir) .Build(); // assert Assert.AreEqual(dir, download.Folder); Assert.IsNull(download.Filename); }
public void TestCorrect() { // act IDownload download = DownloadBuilder.New() .WithUrl(url) .WithFileLocation(path) .Configure(config => { config.ParallelDownload = true; }) .Build(); // assert Assert.AreEqual(folder, download.Folder); Assert.AreEqual(filename, download.Filename); }