public void TryDownloadSubtitle_DownloadSuccessful_RenamesFile(
            Subtitle subtitle,
            string resultFile,
            string fileName,
            [Frozen]ISubtitleDownloader downloader,
            [Frozen]IFileOperations fileOperations,
            SubtitleDownloaderWrapper sut)
        {
            var fileInfo = new FileInfo(resultFile);
            A.CallTo(() => downloader.SaveSubtitle(A<Subtitle>._)).Returns(new List<FileInfo> { fileInfo });

            sut.TryDownloadSubtitle(subtitle, fileName);

            A.CallTo(() => fileOperations.RenameSubtitleFile(fileInfo.FullName, fileName + "." + subtitle.Language.TwoLetterIsoName + ".srt")).MustHaveHappened();
        }
        public void TryDownloadSubtitle_DownloadSuccessful_ReturnsTrue(
            Subtitle subtitle,
            string resultFile,
            string fileName,
            [Frozen]ISubtitleDownloader downloader,
            SubtitleDownloaderWrapper sut)
        {
            A.CallTo(() => downloader.SaveSubtitle(A<Subtitle>._)).Returns(new [] { new FileInfo(resultFile) });

            var result = sut.TryDownloadSubtitle(subtitle, fileName);

            Assert.That(result, Is.True);
        }
        public void TryDownloadSubtitle_DownloaderThrowsException_ReturnsFalse(
            Subtitle subtitle,
            string fileName,
            [Frozen]ISubtitleDownloader downloader,
            SubtitleDownloaderWrapper sut)
        {
            A.CallTo(() => downloader.SaveSubtitle(A<Subtitle>._)).Throws<Exception>();

            bool result = sut.TryDownloadSubtitle(subtitle, fileName);

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