Example #1
0
        public void RetriesUploads_Test()
        {
            var youtubeFacade = new YoutubeFacade(
                ClientId,
                ClientSecret,
                "Sport Video Analyzer",
                SavedRefreshTokenToMyChannel.ConvertToSecureString());
            var videoUploadTask = youtubeFacade
                                  .UploadVideo(
                SampleFiles.Helicopter_1min_48sec,
                "Test video",
                "Test description",
                CancellationToken.None);

            videoUploadTask.Wait();
            var videoId = videoUploadTask.Result;

            Assert.IsNotNull(youtubeFacade.GetVideoInfo(videoId));

            var deleteResult = youtubeFacade.DeleteVideo(videoId);

            // ждем 5 сек пока ютуб расчехлится, что видео удалено.
            Thread.Sleep(5000);
            Assert.IsNull(youtubeFacade.GetVideoInfo(videoId));
        }
Example #2
0
        public async void UploadToPlaylist_Test()
        {
            var youtubeFacade = new YoutubeFacade(
                ClientId,
                ClientSecret,
                "Sport Video Analyzer",
                SavedRefreshTokenToMyChannel.ConvertToSecureString());
            var videoId = await youtubeFacade
                          .UploadVideo(
                SampleFiles.Helicopter_1min_48sec,
                "Test video",
                "Test description",
                CancellationToken.None);

            await youtubeFacade.AddToPlayList(videoId, "PLC66zCbeSJSxdwzMkVZMqx7zVpb4cUZz7");

            Assert.IsNotNull(youtubeFacade.GetVideoInfo(videoId));

            var deleteResult = youtubeFacade.DeleteVideo(videoId);

            // ждем 2 сек пока ютуб расчехлится, что видео удалено.
            Thread.Sleep(2000);
            Assert.IsNull(youtubeFacade.GetVideoInfo(videoId));
        }
Example #3
0
 public void GetVideoInfo_Test()
 {
     var youtube = new YoutubeFacade(ClientId, ClientSecret, "IA.Episodes", SavedRefreshTokenToMyChannel.ConvertToSecureString());
     var info    = youtube.GetVideoInfo("KmSnmcuUZYs");
 }