Esempio n. 1
0
        public void TestBlackSails()
        {
            // Arrange
            var program       = new TestProgram("Black Sails", "XVIII.", 0, "S02E10");
            var seriesNameMap = new Dictionary <string, string>(1);
            //seriesNameMap.Add("Blue Bloods", "id=164981");
            var mockConfig = new Moq.Mock <IConfiguration>();

            mockConfig.Setup(x => x.getSeriesNameMap()).Returns(seriesNameMap);
            mockConfig.Setup(x => x.UpdateMatchedEpisodes).Returns(true);
            mockConfig.Setup(x => x.UpdateSubtitlesParameter).Returns(true);
            mockConfig.Setup(x => x.GetProperty(Moq.It.Is <string>((c) => c == "TvDbLanguage"))).Returns("en");
            var tvDbApi  = new TvDbService(GetWorkingDirectory(), Config.Instance.ApiKey);
            var enricher = new TvdbLibAccess(mockConfig.Object, EpisodeMatchMethodLoader.GetMatchMethods(), tvDbApi);
            var series   = enricher.GetTvdbSeries(enricher.getSeriesId(program.Title), false);

            // Act
            enricher.EnrichProgram(program, series);
            // Assert
            program.Assert();
        }
Esempio n. 2
0
        public void TestAgathaChristiesMarple()
        {
            // Arrange
            var program       = new TestProgram("Agatha Christie's Marple", "Murder at the Vicarage", 0, "S01E02");
            var seriesNameMap = new Dictionary <string, string>(1);

            seriesNameMap.Add("Agatha Christie's Marple", "id=78895");
            var mockConfig = new Moq.Mock <IConfiguration>();

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

            // Act
            enricher.EnrichProgram(program, series);
            // Assert
            program.Assert();
        }
 public void TestBlackSails()
 {
     // Arrange
     var program = new TestProgram("Black Sails", "XVIII.", 0, "S02E10");
     var seriesNameMap = new Dictionary<string, string>(1);
     //seriesNameMap.Add("Blue Bloods", "id=164981");
     var mockConfig = new Moq.Mock<IConfiguration>();
     mockConfig.Setup(x => x.getSeriesNameMap()).Returns(seriesNameMap);
     mockConfig.Setup(x => x.UpdateMatchedEpisodes).Returns(true);
     mockConfig.Setup(x => x.UpdateSubtitlesParameter).Returns(true);
     mockConfig.Setup(x => x.GetProperty(Moq.It.Is<string>((c) => c == "TvDbLanguage"))).Returns("en");
     var tvDbApi = new TvDbService(GetWorkingDirectory(), Config.Instance.ApiKey);
     var enricher = new TvdbLibAccess(mockConfig.Object, EpisodeMatchMethodLoader.GetMatchMethods(), tvDbApi);
     var series = enricher.GetTvdbSeries(enricher.getSeriesId(program.Title), false);
     // Act
     enricher.EnrichProgram(program, series);
     // Assert
     program.Assert();
 }        
 public void TestAgathaChristiesMarple()
 {
     // Arrange
     var program = new TestProgram("Agatha Christie's Marple", "Murder at the Vicarage", 0, "S01E02");
     var seriesNameMap = new Dictionary<string, string>(1);
     seriesNameMap.Add("Agatha Christie's Marple", "id=78895");
     var mockConfig = new Moq.Mock<IConfiguration>();
     mockConfig.Setup(x => x.getSeriesNameMap()).Returns(seriesNameMap);
     mockConfig.Setup(x => x.UpdateMatchedEpisodes).Returns(true);
     mockConfig.Setup(x => x.UpdateSubtitlesParameter).Returns(true);
     var tvDbApi = new TvDbService(GetWorkingDirectory(), Config.Instance.ApiKey);
     var enricher = new TvdbLibAccess(mockConfig.Object, EpisodeMatchMethodLoader.GetMatchMethods(), tvDbApi);
     var series = enricher.GetTvdbSeries(enricher.getSeriesId(program.Title), false);
     // Act
     enricher.EnrichProgram(program, series);
     // Assert
     program.Assert();
 }