fixed more tests.

This commit is contained in:
kay.one 2013-03-31 23:22:16 -07:00
commit 048162a0ef
45 changed files with 424 additions and 677 deletions

View file

@ -6,13 +6,11 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
{
public class NotInQueueSpecification : IFetchableSpecification
{
private readonly DownloadProvider _downloadProvider;
private readonly IProvideDownloadClient _downloadClientProvider;
public NotInQueueSpecification(DownloadProvider downloadProvider)
public NotInQueueSpecification(IProvideDownloadClient downloadClientProvider)
{
_downloadProvider = downloadProvider;
_downloadClientProvider = downloadClientProvider;
}
public string RejectionReason
@ -25,7 +23,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
public virtual bool IsSatisfiedBy(EpisodeParseResult subject)
{
return !_downloadProvider.GetActiveDownloadClient().IsInQueue(subject);
return !_downloadClientProvider.GetDownloadClient().IsInQueue(subject);
}
}

View file

@ -29,8 +29,8 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
{
foreach (var file in subject.Episodes.Select(c => c.EpisodeFile).Where(c => c != null))
{
_logger.Trace("Comparing file quality with report. Existing file is {0} proper:{1}", file.Quality, file.Proper);
if (!_qualityUpgradableSpecification.IsUpgradable(subject.Series.QualityProfile, new QualityModel { Quality = file.Quality, Proper = file.Proper }, subject.Quality))
_logger.Trace("Comparing file quality with report. Existing file is {0}", file.Quality);
if (!_qualityUpgradableSpecification.IsUpgradable(subject.Series.QualityProfile, file.Quality, subject.Quality))
return false;
if (subject.Quality.Proper && file.DateAdded < DateTime.Today.AddDays(-7))