public void RemoteProviderInvalidIdTest(string path)
        {
            _epInfo.Path = path;
            var provider = new YTDLEpisodeProvider(_jf_fs.Object, new Mock <Microsoft.Extensions.Logging.ILogger <YTDLEpisodeProvider> >().Object, _config.Object, _fs);
            var metadata = provider.GetMetadata(_epInfo, _token);

            metadata.Wait();
            Assert.False(metadata.Result.HasMetadata);
        }
 public YTDLEpisodeProviderTest()
 {
     _jf_fs  = new Mock <MediaBrowser.Model.IO.IFileSystem>();
     _fs     = new MockFileSystem(new Dictionary <string, MockFileData> {
     });
     _config = new Mock <MediaBrowser.Controller.Configuration.IServerConfigurationManager>();
     _config.Setup(config => config.ApplicationPaths.CachePath).Returns("\\cache");
     _epInfo      = new EpisodeInfo();
     _fs_metadata = new MediaBrowser.Model.IO.FileSystemMetadata();
     _token       = new CancellationToken();
     _provider    = new YTDLEpisodeProvider(_jf_fs.Object, new Mock <Microsoft.Extensions.Logging.ILogger <YTDLEpisodeProvider> >().Object, _config.Object, _fs);
 }
        public void YTDLJsonToMovieTest()
        {
            var json = new YTDLData
            {
                uploader    = "Someone",
                upload_date = "20211215",
                title       = "Cool Video",
                description = "This is the best video.",
                channel_id  = "12345",
                thumbnail   = "somelink"
            };
            var result = YTDLEpisodeProvider.YTDLJsonToEpisode(json);

            Assert.Equal(json.title, result.Item.Name);
            Assert.Equal(json.description, result.Item.Overview);
            Assert.Equal(2021, result.Item.ProductionYear);
            Assert.Equal(DateTime.ParseExact(json.upload_date, "yyyyMMdd", null), result.Item.PremiereDate);
            Assert.Equal(1, result.Item.IndexNumber);
            Assert.Equal(1, result.Item.ParentIndexNumber);
            Assert.Equal("Someone", result.People[0].Name);
        }
        public void YTDLJsonToMovie(YTDLData json, MetadataResult <Movie> expected)
        {
            var result = JsonSerializer.Serialize(YTDLEpisodeProvider.YTDLJsonToMovie(json));

            Assert.Equal(JsonSerializer.Serialize(expected), result);
        }