public void ApplyEnhancements_DuplicateEnhancementRequestsMade_OnlyUniqueResultsAddedToIdentity(
            string filePath,
            TvReleaseIdentity identity,
            TvDbEnhancement tvDbEnhancement,
            SubDbFileHashEnhancement subDbFileHashEnhancement,
            IEpisodeSubtitleDownloader downloader,
            IEnhancementProvider enhancementProvider
            )
        {
            var expectedEnhancements = new IEnhancement[] {tvDbEnhancement, subDbFileHashEnhancement};
            var downloaders = new[] {downloader};
            var enhancementRequests = new IEnhancementRequest[]
            {
                new EnhancementRequest<TvDbEnhancement>(),
                new EnhancementRequest<TvDbEnhancement>(),
                new EnhancementRequest<SubDbFileHashEnhancement>()
            };
            A.CallTo(() => downloader.EnhancementRequests).Returns(enhancementRequests);
            A.CallTo(
                () =>
                    enhancementProvider.GetEnhancement(A<Type>.That.IsEqualTo(typeof (TvDbEnhancement)), filePath,
                        identity))
                .Returns(tvDbEnhancement);
            A.CallTo(
                () =>
                    enhancementProvider.GetEnhancement(A<Type>.That.IsEqualTo(typeof (SubDbFileHashEnhancement)),
                        filePath, identity))
                .Returns(subDbFileHashEnhancement);
            var sut = new EnhancementApplicator(downloaders, enhancementProvider);

            sut.ApplyEnhancements(filePath, identity);

            Assert.That(identity.Enhancements, Is.EquivalentTo(expectedEnhancements));
        }
        public void DownloadSubtitle_DownloaderHasEnhancementRequests_ProvidesEnhancements(
            SubDbFileHashEnhancement enhancement,
            string file,
            TvReleaseIdentity identity,
            Subtitle[] matches,
            [Frozen]IEnumerable<IEpisodeSubtitleDownloader> downloaders,
            [Frozen]IEnhancementProvider enhancementProvider,
            SubtitleDownloadService sut
            )
        {
            var languages = matches.Select(m => m.Language);
            var downloaderWithRequest = downloaders.First();
            A.CallTo(() => downloaderWithRequest.CanHandleAtLeastOneOf(A<Language[]>._)).Returns(true);
            A.CallTo(() => downloaderWithRequest.EnhancementRequests)
                .Returns(new[] {new EnhancementRequest<SubDbFileHashEnhancement>()});
            A.CallTo(() => enhancementProvider.GetEnhancement(typeof(SubDbFileHashEnhancement), file, identity))
                .Returns(enhancement);

            sut.DownloadSubtitle(file, identity, languages);

            A.CallTo(() => downloaderWithRequest.SearchSubtitle(
                A<TvReleaseIdentity>.That.Matches(r => r.Enhancements.Contains(enhancement)),
                A<IEnumerable<Language>>._)).MustHaveHappened();
        }