Esempio n. 1
0
        public void TestMappingNameWithID()
        {
            var lawOrderProgram = new TestProgram("Law & Order: Special Victims Unit", "Identity", 0, "S06E12");
            var seriesNameMap   = new Dictionary <string, string>(1);

            seriesNameMap.Add("Law & Order: Special Victims Unit", "id=75692");
            var mockConfig = new Moq.Mock <IConfiguration>();

            mockConfig.Setup(x => x.getSeriesNameMap()).Returns(seriesNameMap);
            var tvDbApi  = new TvDbService(GetWorkingDirectory(), Config.Instance.ApiKey);
            var enricher = new TvdbLibAccess(mockConfig.Object, EpisodeMatchMethodLoader.GetMatchMethods(), tvDbApi);
            var series   = enricher.GetTvdbSeries(enricher.getSeriesId(lawOrderProgram.Title), false);

            enricher.EnrichProgram(lawOrderProgram, series);
            Assert.True(lawOrderProgram.EpisodeIsEnriched());
        }
Esempio n. 2
0
        public void TestMappingRegex()
        {
            var lawOrderProgram = new TestProgram("Stargate Atlantis123", "Common Ground", 0, "S03E07");
            var seriesNameMap   = new Dictionary <string, string>(1);

            seriesNameMap.Add("regex=Stargate Atl.*", "Stargate Atlantis");
            var mockConfig = new Moq.Mock <IConfiguration>();

            mockConfig.Setup(x => x.getSeriesNameMap()).Returns(seriesNameMap);
            var tvDbApi  = new TvDbService(GetWorkingDirectory(), Config.Instance.ApiKey);
            var enricher = new TvdbLibAccess(mockConfig.Object, EpisodeMatchMethodLoader.GetMatchMethods(), tvDbApi);
            var series   = enricher.GetTvdbSeries(enricher.getSeriesId(lawOrderProgram.Title), false);

            enricher.EnrichProgram(lawOrderProgram, series);
            Assert.True(lawOrderProgram.EpisodeIsEnriched());
        }
 public void TestMappingNameWithID()
 {
     var lawOrderProgram = new TestProgram("Law & Order: Special Victims Unit", "Identity", 0, "S06E12");
     var seriesNameMap = new Dictionary<string, string>(1);
     seriesNameMap.Add("Law & Order: Special Victims Unit", "id=75692");
     var mockConfig = new Moq.Mock<IConfiguration>();
     mockConfig.Setup(x => x.getSeriesNameMap()).Returns(seriesNameMap);
     var tvDbApi = new TvDbService(GetWorkingDirectory(), Config.Instance.ApiKey);
     var enricher = new TvdbLibAccess(mockConfig.Object, EpisodeMatchMethodLoader.GetMatchMethods(), tvDbApi);
     var series = enricher.GetTvdbSeries(enricher.getSeriesId(lawOrderProgram.Title), false);
     enricher.EnrichProgram(lawOrderProgram, series);
     Assert.True(lawOrderProgram.EpisodeIsEnriched());
 }
 public void TestRegularMapping()
 {
     var lawOrderProgram = new TestProgram("Stargate Atlantis123", "Common Ground", 0, "S03E07");
     var seriesNameMap = new Dictionary<string, string>(1);
     seriesNameMap.Add("Stargate Atlantis123", "Stargate Atlantis");
     var mockConfig = new Moq.Mock<IConfiguration>();
     mockConfig.Setup(x => x.getSeriesNameMap()).Returns(seriesNameMap);
     //
     var tvDbApi = new TvDbService(GetWorkingDirectory(), Config.Instance.ApiKey);
     var enricher = new TvdbLibAccess(mockConfig.Object, EpisodeMatchMethodLoader.GetMatchMethods(), tvDbApi);
     var series = enricher.GetTvdbSeries(enricher.getSeriesId(lawOrderProgram.Title), false);
     enricher.EnrichProgram(lawOrderProgram, series);
     Assert.True(lawOrderProgram.EpisodeIsEnriched());
 }