예제 #1
0
 public FileProcessor(IEpisodeParser episodeParser, ILogger logger, ISubtitleDownloadService subtitleService, 
                      IFileOperations fileOperations, LanguageSettings languageSettings)
 {
     _episodeParser = episodeParser;
     _logger = logger;
     _subtitleService = subtitleService;
     _fileOperations = fileOperations;
     _languageSettings = languageSettings;
 }
        public void ProcessFile_AllLanguagesAlreadyDownloaded_ReturnsTrue( 
            Language[] languages,
            string fileName,
            TvReleaseIdentity tvRelease,
            ILogger logger,
            IEpisodeParser episodeParser,
            ISubtitleDownloadService subtitleService,
            [Frozen]IFileOperations fileOperations,
            FileProcessor sut)
        {
            var settings = new LanguageSettings(languages);
            A.CallTo(() => fileOperations.GetDowloadedSubtitleLanguages(A<string>._, languages)).Returns(languages);
            A.CallTo(() => subtitleService.DownloadSubtitle(A<string>._, A<TvReleaseIdentity>._, A<IEnumerable<Language>>._))
                .Returns(false);
            A.CallTo(() => episodeParser.ParseEpisodeInfo(A<string>._)).Returns(tvRelease);
            var processor = new FileProcessor(episodeParser, logger, subtitleService, fileOperations, settings);

            bool result = processor.ProcessFile(fileName, new string[0]);

            Assert.That(result, Is.True);
        }