public async Task GetVideoListAsync_VideoIds_Is_Null()
        {
            try
            {
                await _youtubeService.GetVideosByIdsAsync(null);

                Assert.Fail();
            }
            catch (ArgumentNullException ex)
            {
                Assert.IsTrue(ex.ParamName == _VIDEOS_IDS_PARAM_NAME);
            }
        }
Beispiel #2
0
        private async Task GravarHistoricoVideos(YouTubeResponseViewModel result)
        {
            var lista = result.Items
                        .Where(w => w.Tipo == ResultType.Video)
                        .Select(s => s.YoutubeVideoId)
                        .ToList();
            var videosDetails = await _youTubeService.GetVideosByIdsAsync(lista);

            await _videoService.SincronizarVideosAsync(videosDetails);
        }
        public async Task GetVideoListAsync_Falha_Requisicao()
        {
            try
            {
                await _youtubeClientComChaveErrada.GetVideosByIdsAsync(new List <string> {
                    "PYRbC7vDxio", "jOx0JEC_3P4"
                });

                Assert.Fail();
            }
            catch (GoogleApiException)
            {
                Assert.Pass();
            }
        }