public void AsAudioOnly_WithNullVideoList_ThrowsArgumentNullException() { IStateNotifier stateNotifier = new IStateNotifierMock(); Downloader target = new Downloader(stateNotifier); string outputDirectory = string.Empty; IList<YoutubeVideo> videos = null; target.AsAudioOnly(outputDirectory, videos); }
private void downloadSingleVideoAsVideo(string uri, string outputDirectory) { var video = GetVideoFromSingleVideo(uri); var downloader = new Downloader(this); downloader.AsVideo(outputDirectory, new System.Collections.Generic.List<YoutubeVideo> { video }); }
private void downloadPlaylistAsVideo(string uri, string outputDirectory) { var videos = GetListOfVideosFromPlaylist(uri); var downloader = new Downloader(this); downloader.AsVideo(outputDirectory, videos); }
public void DownloadAndSaveAsTempFile_WithNullYoutubeVideo_ThrowsArgumentNullException() { IStateNotifier stateNotifier = new IStateNotifierMock(); Downloader target = new Downloader(stateNotifier); YoutubeVideo youTubeVideo = null; target.DownloadAndSaveAsTempFile(youTubeVideo); }
public void DownloaderConstructor_WithNullStateNotifier_ThrowsArgumentNullException() { IStateNotifier stateNotifier = null; Downloader target = new Downloader(stateNotifier); }
public void DownloadOneSongAsAudioOnly() { var flvUri = "http://youtube.com/get_video?video_id=y6_-cLWwEU0&t=OEgsToPDskK4SK4mp23uC0fNwECBlETt"; var video = new YoutubeVideo { Title = "cool song", FlvUri = flvUri }; var downloader = new Downloader(new IStateNotifierMock()); var files = downloader.AsAudioOnly(string.Empty, new List<YoutubeVideo> { video }); Assert.AreEqual(1, files.Count); Assert.AreEqual("cool song.mp3", files[0].GetFileName()); }