public async Task FullSizeTest() { const string expected = "http://full.pr0gramm.com/2016/02/24/1db2dd03de191f02.jpg"; var item = _items[10]; var expectedFile = await DownloadExpectedFile(expected); using (var dl = new ItemDownloader(DownloadKind.LargestAvailable, true)) { var actualStream = await dl.DownloadItemAsync(item); var actualFile = await StreamToFile(actualStream); CompareFiles(expectedFile, actualFile); } }
public async Task ImageTest() { const string expected = "http://img.pr0gramm.com/2016/02/25/c39ca11598127046.png"; var item = _items[0]; var expectedFile = await DownloadExpectedFile(expected); using (var dl = new ItemDownloader(DownloadKind.NormalImage, true)) { var actualStream = await dl.DownloadItemAsync(item); var actualFile = await StreamToFile(actualStream); CompareFiles(expectedFile, actualFile); } }
public async Task ThumbnailTest() { const string expected = "http://thumb.pr0gramm.com/2016/02/25/4d99cd2f33f62273.jpg"; var item = _items[0]; var expectedFile = await DownloadExpectedFile(expected); using (var dl = new ItemDownloader(DownloadKind.Thumbnail, true)) { var actualStream = await dl.DownloadItemAsync(item); var actualFile = await StreamToFile(actualStream); CompareFiles(expectedFile, actualFile); } }
public async Task WebmTest() { const string expected = "http://img.pr0gramm.com/2016/02/25/e140680dcdb3daa4.webm"; var item = _items[1]; Assert.NotNull(item); var expectedFile = await DownloadExpectedFile(expected); using (var dl = new ItemDownloader(DownloadKind.NormalImage, true)) { var actualStream = await dl.DownloadItemAsync(item); var actualFile = await StreamToFile(actualStream); CompareFiles(expectedFile, actualFile); } }
public async Task Mp4Test() { const string expected = "http://img.pr0gramm.com/2016/02/25/956743d57e310de0.mp4"; var item = _items[2]; Assert.NotNull(item); var expectedFile = await DownloadExpectedFile(expected); using (var dl = new ItemDownloader(DownloadKind.NormalImage, true)) { var actualStream = await dl.DownloadItemAsync(item); var actualFile = await StreamToFile(actualStream); CompareFiles(expectedFile, actualFile); } }