mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-25 22:36:59 -04:00
Rename MP3-320 to MP3
This commit is contained in:
@@ -46,7 +46,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
|
||||
_firstFile = new BookFile { Quality = new QualityModel(Quality.FLAC, new Revision(version: 2)), DateAdded = DateTime.Now };
|
||||
|
||||
_mp3 = new QualityModel(Quality.MP3_320, new Revision(version: 1));
|
||||
_mp3 = new QualityModel(Quality.MP3, new Revision(version: 1));
|
||||
_flac = new QualityModel(Quality.FLAC, new Revision(version: 1));
|
||||
|
||||
_remoteBook = new RemoteBook
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
Subject.CutoffNotMet(
|
||||
new QualityProfile
|
||||
{
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Cutoff = Quality.MP3.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities()
|
||||
},
|
||||
new List<QualityModel> { new QualityModel(Quality.Unknown, new Revision(version: 2)) },
|
||||
@@ -32,10 +32,10 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
Subject.CutoffNotMet(
|
||||
new QualityProfile
|
||||
{
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Cutoff = Quality.MP3.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities()
|
||||
},
|
||||
new List<QualityModel> { new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
|
||||
new List<QualityModel> { new QualityModel(Quality.MP3, new Revision(version: 2)) },
|
||||
NoPreferredWordScore).Should().BeFalse();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
Cutoff = Quality.AZW3.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities()
|
||||
},
|
||||
new List<QualityModel> { new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
|
||||
new List<QualityModel> { new QualityModel(Quality.MP3, new Revision(version: 2)) },
|
||||
NoPreferredWordScore).Should().BeFalse();
|
||||
}
|
||||
|
||||
@@ -58,12 +58,12 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
Subject.CutoffNotMet(
|
||||
new QualityProfile
|
||||
{
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Cutoff = Quality.MP3.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities()
|
||||
},
|
||||
new List<QualityModel> { new QualityModel(Quality.MP3_320, new Revision(version: 1)) },
|
||||
new List<QualityModel> { new QualityModel(Quality.MP3, new Revision(version: 1)) },
|
||||
NoPreferredWordScore,
|
||||
new QualityModel(Quality.MP3_320, new Revision(version: 2))).Should().BeTrue();
|
||||
new QualityModel(Quality.MP3, new Revision(version: 2))).Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -72,10 +72,10 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
Subject.CutoffNotMet(
|
||||
new QualityProfile
|
||||
{
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Cutoff = Quality.MP3.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities()
|
||||
},
|
||||
new List<QualityModel> { new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
|
||||
new List<QualityModel> { new QualityModel(Quality.MP3, new Revision(version: 2)) },
|
||||
NoPreferredWordScore,
|
||||
new QualityModel(Quality.FLAC, new Revision(version: 2))).Should().BeFalse();
|
||||
}
|
||||
@@ -85,13 +85,13 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
{
|
||||
QualityProfile profile = new QualityProfile
|
||||
{
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Cutoff = Quality.MP3.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
};
|
||||
|
||||
Subject.CutoffNotMet(
|
||||
profile,
|
||||
new List<QualityModel> { new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
|
||||
new List<QualityModel> { new QualityModel(Quality.MP3, new Revision(version: 2)) },
|
||||
NoPreferredWordScore,
|
||||
new QualityModel(Quality.FLAC, new Revision(version: 2)),
|
||||
10).Should().BeTrue();
|
||||
@@ -102,7 +102,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
{
|
||||
QualityProfile profile = new QualityProfile
|
||||
{
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Cutoff = Quality.MP3.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
};
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(c => c.QualityProfile = new QualityProfile
|
||||
{
|
||||
UpgradeAllowed = true,
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Cutoff = Quality.MP3.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities()
|
||||
})
|
||||
.Build();
|
||||
@@ -57,19 +57,19 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
_parseResultMulti = new RemoteBook
|
||||
{
|
||||
Author = _fakeAuthor,
|
||||
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
|
||||
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3, new Revision(version: 2)) },
|
||||
Books = doubleBookList
|
||||
};
|
||||
|
||||
_parseResultSingle = new RemoteBook
|
||||
{
|
||||
Author = _fakeAuthor,
|
||||
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
|
||||
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3, new Revision(version: 2)) },
|
||||
Books = singleBookList
|
||||
};
|
||||
|
||||
_upgradableQuality = new QualityModel(Quality.MP3_320, new Revision(version: 1));
|
||||
_notupgradableQuality = new QualityModel(Quality.MP3_320, new Revision(version: 2));
|
||||
_upgradableQuality = new QualityModel(Quality.MP3, new Revision(version: 1));
|
||||
_notupgradableQuality = new QualityModel(Quality.MP3, new Revision(version: 2));
|
||||
|
||||
Mocker.GetMock<IConfigService>()
|
||||
.SetupGet(s => s.EnableCompletedDownloadHandling)
|
||||
@@ -164,9 +164,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_not_be_upgradable_if_book_is_of_same_quality_as_existing()
|
||||
{
|
||||
_fakeAuthor.QualityProfile = new QualityProfile { Cutoff = Quality.MP3_320.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
|
||||
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320, new Revision(version: 1));
|
||||
_upgradableQuality = new QualityModel(Quality.MP3_320, new Revision(version: 1));
|
||||
_fakeAuthor.QualityProfile = new QualityProfile { Cutoff = Quality.MP3.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
|
||||
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3, new Revision(version: 1));
|
||||
_upgradableQuality = new QualityModel(Quality.MP3, new Revision(version: 1));
|
||||
|
||||
GivenMostRecentForBook(FIRST_ALBUM_ID, string.Empty, _upgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
|
||||
|
||||
@@ -176,9 +176,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_not_be_upgradable_if_cutoff_already_met()
|
||||
{
|
||||
_fakeAuthor.QualityProfile = new QualityProfile { Cutoff = Quality.MP3_320.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
|
||||
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320, new Revision(version: 1));
|
||||
_upgradableQuality = new QualityModel(Quality.MP3_320, new Revision(version: 1));
|
||||
_fakeAuthor.QualityProfile = new QualityProfile { Cutoff = Quality.MP3.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
|
||||
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3, new Revision(version: 1));
|
||||
_upgradableQuality = new QualityModel(Quality.MP3, new Revision(version: 1));
|
||||
|
||||
GivenMostRecentForBook(FIRST_ALBUM_ID, string.Empty, _upgradableQuality, DateTime.UtcNow, HistoryEventType.Grabbed);
|
||||
|
||||
@@ -204,9 +204,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void should_return_false_if_cutoff_already_met_and_cdh_is_disabled()
|
||||
{
|
||||
GivenCdhDisabled();
|
||||
_fakeAuthor.QualityProfile = new QualityProfile { Cutoff = Quality.MP3_320.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
|
||||
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320, new Revision(version: 1));
|
||||
_upgradableQuality = new QualityModel(Quality.MP3_320, new Revision(version: 1));
|
||||
_fakeAuthor.QualityProfile = new QualityProfile { Cutoff = Quality.MP3.Id, Items = Qualities.QualityFixture.GetDefaultQualities() };
|
||||
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3, new Revision(version: 1));
|
||||
_upgradableQuality = new QualityModel(Quality.MP3, new Revision(version: 1));
|
||||
|
||||
GivenMostRecentForBook(FIRST_ALBUM_ID, "test", _upgradableQuality, DateTime.UtcNow.AddDays(-100), HistoryEventType.Grabbed);
|
||||
|
||||
|
||||
@@ -73,8 +73,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_put_reals_before_non_reals()
|
||||
{
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320, new Revision(version: 1, real: 0)));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320, new Revision(version: 1, real: 1)));
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3, new Revision(version: 1, real: 0)));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3, new Revision(version: 1, real: 1)));
|
||||
|
||||
var decisions = new List<DownloadDecision>();
|
||||
decisions.Add(new DownloadDecision(remoteBook1));
|
||||
@@ -87,8 +87,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_put_propers_before_non_propers()
|
||||
{
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320, new Revision(version: 1)));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320, new Revision(version: 2)));
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3, new Revision(version: 1)));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3, new Revision(version: 2)));
|
||||
|
||||
var decisions = new List<DownloadDecision>();
|
||||
decisions.Add(new DownloadDecision(remoteBook1));
|
||||
@@ -101,24 +101,24 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_put_higher_quality_before_lower()
|
||||
{
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
|
||||
var decisions = new List<DownloadDecision>();
|
||||
decisions.Add(new DownloadDecision(remoteBook1));
|
||||
decisions.Add(new DownloadDecision(remoteBook2));
|
||||
|
||||
var qualifiedReports = Subject.PrioritizeDecisions(decisions);
|
||||
qualifiedReports.First().RemoteBook.ParsedBookInfo.Quality.Quality.Should().Be(Quality.MP3_320);
|
||||
qualifiedReports.First().RemoteBook.ParsedBookInfo.Quality.Quality.Should().Be(Quality.MP3);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_order_by_age_then_largest_rounded_to_200mb()
|
||||
{
|
||||
var remoteBookSd = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), size: 100.Megabytes(), age: 1);
|
||||
var remoteBookHdSmallOld = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), size: 1200.Megabytes(), age: 1000);
|
||||
var remoteBookSmallYoung = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), size: 1250.Megabytes(), age: 10);
|
||||
var remoteBookHdLargeYoung = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), size: 3000.Megabytes(), age: 1);
|
||||
var remoteBookSd = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), size: 100.Megabytes(), age: 1);
|
||||
var remoteBookHdSmallOld = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), size: 1200.Megabytes(), age: 1000);
|
||||
var remoteBookSmallYoung = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), size: 1250.Megabytes(), age: 10);
|
||||
var remoteBookHdLargeYoung = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), size: 3000.Megabytes(), age: 1);
|
||||
|
||||
var decisions = new List<DownloadDecision>();
|
||||
decisions.Add(new DownloadDecision(remoteBookSd));
|
||||
@@ -133,8 +133,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_order_by_youngest()
|
||||
{
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), age: 10);
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), age: 5);
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), age: 10);
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), age: 5);
|
||||
|
||||
var decisions = new List<DownloadDecision>();
|
||||
decisions.Add(new DownloadDecision(remoteBook1));
|
||||
@@ -147,8 +147,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_not_throw_if_no_books_are_found()
|
||||
{
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), size: 500.Megabytes());
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), size: 500.Megabytes());
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), size: 500.Megabytes());
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), size: 500.Megabytes());
|
||||
|
||||
remoteBook1.Books = new List<Book>();
|
||||
|
||||
@@ -164,8 +164,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
{
|
||||
GivenPreferredDownloadProtocol(DownloadProtocol.Usenet);
|
||||
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), downloadProtocol: DownloadProtocol.Torrent);
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), downloadProtocol: DownloadProtocol.Usenet);
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), downloadProtocol: DownloadProtocol.Torrent);
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), downloadProtocol: DownloadProtocol.Usenet);
|
||||
|
||||
var decisions = new List<DownloadDecision>();
|
||||
decisions.Add(new DownloadDecision(remoteBook1));
|
||||
@@ -180,8 +180,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
{
|
||||
GivenPreferredDownloadProtocol(DownloadProtocol.Torrent);
|
||||
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), downloadProtocol: DownloadProtocol.Torrent);
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320), downloadProtocol: DownloadProtocol.Usenet);
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), downloadProtocol: DownloadProtocol.Torrent);
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3), downloadProtocol: DownloadProtocol.Usenet);
|
||||
|
||||
var decisions = new List<DownloadDecision>();
|
||||
decisions.Add(new DownloadDecision(remoteBook1));
|
||||
@@ -210,7 +210,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_prefer_quality_over_discography_pack()
|
||||
{
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1), GivenBook(2) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1), GivenBook(2) }, new QualityModel(Quality.MP3));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.FLAC));
|
||||
|
||||
remoteBook1.ParsedBookInfo.Discography = true;
|
||||
@@ -226,8 +226,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_prefer_single_book_over_multi_book()
|
||||
{
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1), GivenBook(2) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1), GivenBook(2) }, new QualityModel(Quality.MP3));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
|
||||
var decisions = new List<DownloadDecision>();
|
||||
decisions.Add(new DownloadDecision(remoteBook1));
|
||||
@@ -240,8 +240,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_prefer_releases_with_more_seeders()
|
||||
{
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
|
||||
var torrentInfo1 = new TorrentInfo();
|
||||
torrentInfo1.PublishDate = DateTime.Now;
|
||||
@@ -266,8 +266,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_prefer_releases_with_more_peers_given_equal_number_of_seeds()
|
||||
{
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
|
||||
var torrentInfo1 = new TorrentInfo();
|
||||
torrentInfo1.PublishDate = DateTime.Now;
|
||||
@@ -293,8 +293,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_prefer_releases_with_more_peers_no_seeds()
|
||||
{
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
|
||||
var torrentInfo1 = new TorrentInfo();
|
||||
torrentInfo1.PublishDate = DateTime.Now;
|
||||
@@ -321,8 +321,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_prefer_first_release_if_peers_and_size_are_too_similar()
|
||||
{
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
|
||||
var torrentInfo1 = new TorrentInfo();
|
||||
torrentInfo1.PublishDate = DateTime.Now;
|
||||
@@ -350,8 +350,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_prefer_first_release_if_age_and_size_are_too_similar()
|
||||
{
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
|
||||
remoteBook1.Release.PublishDate = DateTime.UtcNow.AddDays(-100);
|
||||
remoteBook1.Release.Size = 200.Megabytes();
|
||||
@@ -370,7 +370,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_prefer_quality_over_the_number_of_peers()
|
||||
{
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.AZW3));
|
||||
|
||||
var torrentInfo1 = new TorrentInfo();
|
||||
@@ -399,15 +399,15 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_put_higher_quality_before_lower_always()
|
||||
{
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3_320));
|
||||
var remoteBook1 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
var remoteBook2 = GivenRemoteBook(new List<Book> { GivenBook(1) }, new QualityModel(Quality.MP3));
|
||||
|
||||
var decisions = new List<DownloadDecision>();
|
||||
decisions.Add(new DownloadDecision(remoteBook1));
|
||||
decisions.Add(new DownloadDecision(remoteBook2));
|
||||
|
||||
var qualifiedReports = Subject.PrioritizeDecisions(decisions);
|
||||
qualifiedReports.First().RemoteBook.ParsedBookInfo.Quality.Quality.Should().Be(Quality.MP3_320);
|
||||
qualifiedReports.First().RemoteBook.ParsedBookInfo.Quality.Quality.Should().Be(Quality.MP3);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
+7
-7
@@ -18,9 +18,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
|
||||
public static object[] AllowedTestCases =
|
||||
{
|
||||
new object[] { Quality.MP3_320 },
|
||||
new object[] { Quality.MP3_320 },
|
||||
new object[] { Quality.MP3_320 }
|
||||
new object[] { Quality.MP3 },
|
||||
new object[] { Quality.MP3 },
|
||||
new object[] { Quality.MP3 }
|
||||
};
|
||||
|
||||
public static object[] DeniedTestCases =
|
||||
@@ -33,13 +33,13 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void Setup()
|
||||
{
|
||||
var fakeAuthor = Builder<Author>.CreateNew()
|
||||
.With(c => c.QualityProfile = new QualityProfile { Cutoff = Quality.MP3_320.Id })
|
||||
.With(c => c.QualityProfile = new QualityProfile { Cutoff = Quality.MP3.Id })
|
||||
.Build();
|
||||
|
||||
_remoteBook = new RemoteBook
|
||||
{
|
||||
Author = fakeAuthor,
|
||||
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
|
||||
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3, new Revision(version: 2)) },
|
||||
};
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void should_allow_if_quality_is_defined_in_profile(Quality qualityType)
|
||||
{
|
||||
_remoteBook.ParsedBookInfo.Quality.Quality = qualityType;
|
||||
_remoteBook.Author.QualityProfile.Value.Items = Qualities.QualityFixture.GetDefaultQualities(Quality.MP3_320, Quality.MP3_320, Quality.MP3_320);
|
||||
_remoteBook.Author.QualityProfile.Value.Items = Qualities.QualityFixture.GetDefaultQualities(Quality.MP3, Quality.MP3, Quality.MP3);
|
||||
|
||||
Subject.IsSatisfiedBy(_remoteBook, null).Accepted.Should().BeTrue();
|
||||
}
|
||||
@@ -58,7 +58,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void should_not_allow_if_quality_is_not_defined_in_profile(Quality qualityType)
|
||||
{
|
||||
_remoteBook.ParsedBookInfo.Quality.Quality = qualityType;
|
||||
_remoteBook.Author.QualityProfile.Value.Items = Qualities.QualityFixture.GetDefaultQualities(Quality.MP3_320, Quality.MP3_320, Quality.MP3_320);
|
||||
_remoteBook.Author.QualityProfile.Value.Items = Qualities.QualityFixture.GetDefaultQualities(Quality.MP3, Quality.MP3, Quality.MP3);
|
||||
|
||||
Subject.IsSatisfiedBy(_remoteBook, null).Accepted.Should().BeFalse();
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
_remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _author)
|
||||
.With(r => r.Books = new List<Book> { _book })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320) })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3) })
|
||||
.With(r => r.PreferredWordScore = 0)
|
||||
.Build();
|
||||
}
|
||||
@@ -113,7 +113,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(r => r.Books = new List<Book> { _book })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320)
|
||||
Quality = new QualityModel(Quality.MP3)
|
||||
})
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.Build();
|
||||
@@ -126,7 +126,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_true_when_quality_in_queue_is_lower()
|
||||
{
|
||||
_author.QualityProfile.Value.Cutoff = Quality.MP3_320.Id;
|
||||
_author.QualityProfile.Value.Cutoff = Quality.MP3.Id;
|
||||
|
||||
var remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _author)
|
||||
@@ -150,7 +150,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(r => r.Books = new List<Book> { _otherBook })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320)
|
||||
Quality = new QualityModel(Quality.MP3)
|
||||
})
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.Build();
|
||||
@@ -169,7 +169,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(r => r.Books = new List<Book> { _book })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320)
|
||||
Quality = new QualityModel(Quality.MP3)
|
||||
})
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.Build();
|
||||
@@ -186,7 +186,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(r => r.Books = new List<Book> { _book })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320)
|
||||
Quality = new QualityModel(Quality.MP3)
|
||||
})
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.Build();
|
||||
@@ -205,7 +205,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(r => r.Books = new List<Book> { _book })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320)
|
||||
Quality = new QualityModel(Quality.MP3)
|
||||
})
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.Build();
|
||||
@@ -222,7 +222,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(r => r.Books = new List<Book> { _book, _otherBook })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320)
|
||||
Quality = new QualityModel(Quality.MP3)
|
||||
})
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.Build();
|
||||
@@ -239,7 +239,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(r => r.Books = new List<Book> { _book })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320)
|
||||
Quality = new QualityModel(Quality.MP3)
|
||||
})
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.Build();
|
||||
@@ -258,7 +258,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(r => r.Books = new List<Book> { _book, _otherBook })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320)
|
||||
Quality = new QualityModel(Quality.MP3)
|
||||
})
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.Build();
|
||||
@@ -277,7 +277,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(r => r.Author = _author)
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320)
|
||||
Quality = new QualityModel(Quality.MP3)
|
||||
})
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.TheFirst(1)
|
||||
@@ -321,7 +321,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(r => r.Books = new List<Book> { _book })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320)
|
||||
Quality = new QualityModel(Quality.MP3)
|
||||
})
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.Build();
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
}).ToList();
|
||||
_trackFiles.Select(c =>
|
||||
{
|
||||
c.Quality = new QualityModel(Quality.MP3_320);
|
||||
c.Quality = new QualityModel(Quality.MP3);
|
||||
return c;
|
||||
}).ToList();
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
|
||||
_profile.Items = new List<QualityProfileQualityItem>();
|
||||
_profile.Items.Add(new QualityProfileQualityItem { Allowed = true, Quality = Quality.PDF });
|
||||
_profile.Items.Add(new QualityProfileQualityItem { Allowed = true, Quality = Quality.AZW3 });
|
||||
_profile.Items.Add(new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3_320 });
|
||||
_profile.Items.Add(new QualityProfileQualityItem { Allowed = true, Quality = Quality.MP3 });
|
||||
|
||||
_profile.Cutoff = Quality.AZW3.Id;
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
|
||||
[Test]
|
||||
public void should_be_true_when_quality_is_last_allowed_in_profile()
|
||||
{
|
||||
_remoteBook.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320);
|
||||
_remoteBook.ParsedBookInfo.Quality = new QualityModel(Quality.MP3);
|
||||
|
||||
Subject.IsSatisfiedBy(_remoteBook, null).Accepted.Should().BeTrue();
|
||||
}
|
||||
@@ -149,10 +149,10 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
|
||||
[Test]
|
||||
public void should_be_true_when_release_is_a_proper_for_existing_book()
|
||||
{
|
||||
_remoteBook.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2));
|
||||
_remoteBook.ParsedBookInfo.Quality = new QualityModel(Quality.MP3, new Revision(version: 2));
|
||||
_remoteBook.Release.PublishDate = DateTime.UtcNow;
|
||||
|
||||
GivenExistingFile(new QualityModel(Quality.MP3_320));
|
||||
GivenExistingFile(new QualityModel(Quality.MP3));
|
||||
GivenUpgradeForExistingFile();
|
||||
|
||||
Mocker.GetMock<IUpgradableSpecification>()
|
||||
@@ -167,10 +167,10 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
|
||||
[Test]
|
||||
public void should_be_true_when_release_is_a_real_for_existing_book()
|
||||
{
|
||||
_remoteBook.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320, new Revision(real: 1));
|
||||
_remoteBook.ParsedBookInfo.Quality = new QualityModel(Quality.MP3, new Revision(real: 1));
|
||||
_remoteBook.Release.PublishDate = DateTime.UtcNow;
|
||||
|
||||
GivenExistingFile(new QualityModel(Quality.MP3_320));
|
||||
GivenExistingFile(new QualityModel(Quality.MP3));
|
||||
GivenUpgradeForExistingFile();
|
||||
|
||||
Mocker.GetMock<IUpgradableSpecification>()
|
||||
|
||||
+2
-2
@@ -63,14 +63,14 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
|
||||
_parseResultMulti = new RemoteBook
|
||||
{
|
||||
Author = fakeAuthor,
|
||||
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
|
||||
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3, new Revision(version: 2)) },
|
||||
Books = doubleBookList
|
||||
};
|
||||
|
||||
_parseResultSingle = new RemoteBook
|
||||
{
|
||||
Author = fakeAuthor,
|
||||
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
|
||||
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3, new Revision(version: 2)) },
|
||||
Books = singleBookList
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
UpgradeAllowed = false
|
||||
},
|
||||
new QualityModel(Quality.MP3_320),
|
||||
new QualityModel(Quality.MP3),
|
||||
new QualityModel(Quality.FLAC))
|
||||
.Should().BeFalse();
|
||||
}
|
||||
@@ -36,7 +36,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
UpgradeAllowed = true
|
||||
},
|
||||
new QualityModel(Quality.MP3_320),
|
||||
new QualityModel(Quality.MP3),
|
||||
new QualityModel(Quality.FLAC))
|
||||
.Should().BeTrue();
|
||||
}
|
||||
@@ -51,8 +51,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
UpgradeAllowed = true
|
||||
},
|
||||
new QualityModel(Quality.MP3_320),
|
||||
new QualityModel(Quality.MP3_320))
|
||||
new QualityModel(Quality.MP3),
|
||||
new QualityModel(Quality.MP3))
|
||||
.Should().BeTrue();
|
||||
}
|
||||
|
||||
@@ -66,8 +66,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
UpgradeAllowed = false
|
||||
},
|
||||
new QualityModel(Quality.MP3_320),
|
||||
new QualityModel(Quality.MP3_320))
|
||||
new QualityModel(Quality.MP3),
|
||||
new QualityModel(Quality.MP3))
|
||||
.Should().BeTrue();
|
||||
}
|
||||
|
||||
@@ -81,8 +81,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
UpgradeAllowed = true
|
||||
},
|
||||
new QualityModel(Quality.MP3_320),
|
||||
new QualityModel(Quality.MP3_320))
|
||||
new QualityModel(Quality.MP3),
|
||||
new QualityModel(Quality.MP3))
|
||||
.Should().BeTrue();
|
||||
}
|
||||
|
||||
@@ -96,8 +96,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities(),
|
||||
UpgradeAllowed = false
|
||||
},
|
||||
new QualityModel(Quality.MP3_320),
|
||||
new QualityModel(Quality.MP3_320))
|
||||
new QualityModel(Quality.MP3),
|
||||
new QualityModel(Quality.MP3))
|
||||
.Should().BeTrue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(c => c.QualityProfile = new QualityProfile
|
||||
{
|
||||
UpgradeAllowed = true,
|
||||
Cutoff = Quality.MP3_320.Id,
|
||||
Cutoff = Quality.MP3.Id,
|
||||
Items = Qualities.QualityFixture.GetDefaultQualities()
|
||||
})
|
||||
.Build();
|
||||
@@ -51,26 +51,26 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
_parseResultMulti = new RemoteBook
|
||||
{
|
||||
Author = fakeAuthor,
|
||||
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
|
||||
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3, new Revision(version: 2)) },
|
||||
Books = doubleBookList
|
||||
};
|
||||
|
||||
_parseResultSingle = new RemoteBook
|
||||
{
|
||||
Author = fakeAuthor,
|
||||
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3_320, new Revision(version: 2)) },
|
||||
ParsedBookInfo = new ParsedBookInfo { Quality = new QualityModel(Quality.MP3, new Revision(version: 2)) },
|
||||
Books = singleBookList
|
||||
};
|
||||
}
|
||||
|
||||
private void WithFirstFileUpgradable()
|
||||
{
|
||||
_firstFile.Quality = new QualityModel(Quality.MP3_320);
|
||||
_firstFile.Quality = new QualityModel(Quality.MP3);
|
||||
}
|
||||
|
||||
private void WithSecondFileUpgradable()
|
||||
{
|
||||
_secondFile.Quality = new QualityModel(Quality.MP3_320);
|
||||
_secondFile.Quality = new QualityModel(Quality.MP3);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -113,9 +113,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_not_be_upgradable_if_qualities_are_the_same()
|
||||
{
|
||||
_firstFile.Quality = new QualityModel(Quality.MP3_320);
|
||||
_secondFile.Quality = new QualityModel(Quality.MP3_320);
|
||||
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320);
|
||||
_firstFile.Quality = new QualityModel(Quality.MP3);
|
||||
_secondFile.Quality = new QualityModel(Quality.MP3);
|
||||
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3);
|
||||
Subject.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeFalse();
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void should_be_false_if_some_tracks_are_upgradable_and_some_are_downgrades()
|
||||
{
|
||||
WithFirstFileUpgradable();
|
||||
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3_320);
|
||||
_parseResultSingle.ParsedBookInfo.Quality = new QualityModel(Quality.MP3);
|
||||
Subject.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeFalse();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public static object[] IsUpgradeTestCases =
|
||||
{
|
||||
new object[] { Quality.AZW3, 1, Quality.AZW3, 2, Quality.AZW3, true },
|
||||
new object[] { Quality.MP3_320, 1, Quality.MP3_320, 2, Quality.MP3_320, true },
|
||||
new object[] { Quality.MP3_320, 1, Quality.MP3_320, 1, Quality.MP3_320, false },
|
||||
new object[] { Quality.MP3_320, 1, Quality.AZW3, 2, Quality.MP3_320, false },
|
||||
new object[] { Quality.MP3_320, 1, Quality.AZW3, 2, Quality.MP3_320, false },
|
||||
new object[] { Quality.MP3_320, 1, Quality.MP3_320, 1, Quality.MP3_320, false }
|
||||
new object[] { Quality.MP3, 1, Quality.MP3, 2, Quality.MP3, true },
|
||||
new object[] { Quality.MP3, 1, Quality.MP3, 1, Quality.MP3, false },
|
||||
new object[] { Quality.MP3, 1, Quality.AZW3, 2, Quality.MP3, false },
|
||||
new object[] { Quality.MP3, 1, Quality.AZW3, 2, Quality.MP3, false },
|
||||
new object[] { Quality.MP3, 1, Quality.MP3, 1, Quality.MP3, false }
|
||||
};
|
||||
|
||||
private static readonly int NoPreferredWordScore = 0;
|
||||
@@ -65,9 +65,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
|
||||
Subject.IsUpgradable(
|
||||
profile,
|
||||
new QualityModel(Quality.MP3_320, new Revision(version: 1)),
|
||||
new QualityModel(Quality.MP3, new Revision(version: 1)),
|
||||
NoPreferredWordScore,
|
||||
new QualityModel(Quality.MP3_320, new Revision(version: 2)),
|
||||
new QualityModel(Quality.MP3, new Revision(version: 2)),
|
||||
NoPreferredWordScore)
|
||||
.Should().BeTrue();
|
||||
}
|
||||
@@ -84,9 +84,9 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
|
||||
Subject.IsUpgradable(
|
||||
profile,
|
||||
new QualityModel(Quality.MP3_320, new Revision(version: 1)),
|
||||
new QualityModel(Quality.MP3, new Revision(version: 1)),
|
||||
NoPreferredWordScore,
|
||||
new QualityModel(Quality.MP3_320, new Revision(version: 2)),
|
||||
new QualityModel(Quality.MP3, new Revision(version: 2)),
|
||||
NoPreferredWordScore)
|
||||
.Should().BeFalse();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user