Add release title attribute to GivenRemoteEpisode

This commit is contained in:
pcjones 2023-09-30 11:58:26 +02:00
parent 5abd9eb1ce
commit c974788faa
1 changed files with 6 additions and 5 deletions

View File

@ -47,7 +47,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
.Build();
}
private RemoteEpisode GivenRemoteEpisode(List<Episode> episodes, QualityModel quality, Language language, int age = 0, long size = 0, DownloadProtocol downloadProtocol = DownloadProtocol.Usenet, int indexerPriority = 25)
private RemoteEpisode GivenRemoteEpisode(List<Episode> episodes, QualityModel quality, Language language, int age = 0, long size = 0, DownloadProtocol downloadProtocol = DownloadProtocol.Usenet, int indexerPriority = 25, string releaseTitle = null)
{
var remoteEpisode = new RemoteEpisode();
remoteEpisode.ParsedEpisodeInfo = new ParsedEpisodeInfo();
@ -62,6 +62,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
remoteEpisode.Release.Size = size;
remoteEpisode.Release.DownloadProtocol = downloadProtocol;
remoteEpisode.Release.IndexerPriority = indexerPriority;
remoteEpisode.Release.Title = releaseTitle;
remoteEpisode.Series = Builder<Series>.CreateNew()
.With(e => e.Runtime = 60)
@ -157,10 +158,10 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_order_by_age_then_largest_rounded_to_200mb()
{
var remoteEpisodeSd = GivenRemoteEpisode(new List<Episode> { GivenEpisode(1) }, new QualityModel(Quality.SDTV), Language.English, size: 100.Megabytes(), age: 1);
var remoteEpisodeHdSmallOld = GivenRemoteEpisode(new List<Episode> { GivenEpisode(1) }, new QualityModel(Quality.HDTV720p), Language.English, size: 1200.Megabytes(), age: 1000);
var remoteEpisodeSmallYoung = GivenRemoteEpisode(new List<Episode> { GivenEpisode(1) }, new QualityModel(Quality.HDTV720p), Language.English, size: 1250.Megabytes(), age: 10);
var remoteEpisodeHdLargeYoung = GivenRemoteEpisode(new List<Episode> { GivenEpisode(1) }, new QualityModel(Quality.HDTV720p), Language.English, size: 3000.Megabytes(), age: 1);
var remoteEpisodeSd = GivenRemoteEpisode(new List<Episode> { GivenEpisode(1) }, new QualityModel(Quality.SDTV), Language.English, size: 100.Megabytes(), age: 1, releaseTitle: "Series.Title.S01E01.Pilot.1080p.WEB-DL-RLSGRP");
var remoteEpisodeHdSmallOld = GivenRemoteEpisode(new List<Episode> { GivenEpisode(1) }, new QualityModel(Quality.HDTV720p), Language.English, size: 1200.Megabytes(), age: 1000, releaseTitle: "Series.Title.S01E01.Pilot.1080p.WEB-DL-RLSGRP");
var remoteEpisodeSmallYoung = GivenRemoteEpisode(new List<Episode> { GivenEpisode(1) }, new QualityModel(Quality.HDTV720p), Language.English, size: 1250.Megabytes(), age: 10, releaseTitle: "Series.Title.S01E01.Pilot.1080p.WEB-DL-RLSGRP");
var remoteEpisodeHdLargeYoung = GivenRemoteEpisode(new List<Episode> { GivenEpisode(1) }, new QualityModel(Quality.HDTV720p), Language.English, size: 3000.Megabytes(), age: 1, releaseTitle: "Series.Title.S01E01.Pilot.1080p.WEB-DL-RLSGRP");
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteEpisodeSd));