示例#1
0
        public void GetVideoIdFromQueryString_GoodUrlithExtra_ReturnsIdOfVideo()
        {
            var youtube_dl = new Youtube_Dl("./");
            var id         = "spr5smxuO5E";

            var result = youtube_dl.GetVideoIdFromQueryString(new Uri($"https://www.youtube.com/watch?v={id}&t=8s"));

            Assert.Equal(result, id);
        }
示例#2
0
        public void GetVideoIdFromQueryString_GoodUrl_ReturnsIdOfVideo()
        {
            var youtube_dl = new Youtube_Dl("./");
            var id         = "RKTXn_c2tyQ";

            var result = youtube_dl.GetVideoIdFromQueryString(new Uri($"https://www.youtube.com/watch?v={id}"));

            Assert.Equal(result, id);
        }
示例#3
0
        public void GetVideoIdFromQueryString_BadVideoUrl_ThrowNullArguementException()
        {
            var youtube_dl = new Youtube_Dl("./");

            Assert.Throws <ArgumentNullException>(() => youtube_dl.GetVideoIdFromQueryString(new Uri("https://www.youtube.com/watch?b=Test&v=RKTXn_c2tyQ")));
        }
示例#4
0
        public void GetVideoIdFromQueryString_MissingQueryString_ThrowNullArguementException()
        {
            var youtube_dl = new Youtube_Dl("./");

            Assert.Throws <ArgumentNullException>(() => youtube_dl.GetVideoIdFromQueryString(new Uri("https://youtube.com")));
        }