mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-20 21:54:25 -04:00
Cleanup Conflicts in Sonarr/Lidarr Pulls
Co-Authored-By: Robin Dadswell <19610103+RobinDadswell@users.noreply.github.com>
This commit is contained in:
@@ -17,12 +17,12 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[TestFixture]
|
||||
public class QueueSpecificationFixture : CoreTest<QueueSpecification>
|
||||
{
|
||||
private Author _artist;
|
||||
private Book _album;
|
||||
private Author _author;
|
||||
private Book _book;
|
||||
private RemoteBook _remoteBook;
|
||||
|
||||
private Author _otherArtist;
|
||||
private Book _otherAlbum;
|
||||
private Author _otherAuthor;
|
||||
private Book _otherBook;
|
||||
|
||||
private ReleaseInfo _releaseInfo;
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
{
|
||||
Mocker.Resolve<UpgradableSpecification>();
|
||||
|
||||
_artist = Builder<Author>.CreateNew()
|
||||
_author = Builder<Author>.CreateNew()
|
||||
.With(e => e.QualityProfile = new QualityProfile
|
||||
{
|
||||
UpgradeAllowed = true,
|
||||
@@ -39,16 +39,16 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
})
|
||||
.Build();
|
||||
|
||||
_album = Builder<Book>.CreateNew()
|
||||
.With(e => e.AuthorId = _artist.Id)
|
||||
_book = Builder<Book>.CreateNew()
|
||||
.With(e => e.AuthorId = _author.Id)
|
||||
.Build();
|
||||
|
||||
_otherArtist = Builder<Author>.CreateNew()
|
||||
_otherAuthor = Builder<Author>.CreateNew()
|
||||
.With(s => s.Id = 2)
|
||||
.Build();
|
||||
|
||||
_otherAlbum = Builder<Book>.CreateNew()
|
||||
.With(e => e.AuthorId = _otherArtist.Id)
|
||||
_otherBook = Builder<Book>.CreateNew()
|
||||
.With(e => e.AuthorId = _otherAuthor.Id)
|
||||
.With(e => e.Id = 2)
|
||||
.Build();
|
||||
|
||||
@@ -56,8 +56,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.Build();
|
||||
|
||||
_remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _artist)
|
||||
.With(r => r.Books = new List<Book> { _album })
|
||||
.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.PreferredWordScore = 0)
|
||||
.Build();
|
||||
@@ -91,11 +91,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_true_when_artist_doesnt_match()
|
||||
public void should_return_true_when_author_doesnt_match()
|
||||
{
|
||||
var remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _otherArtist)
|
||||
.With(r => r.Books = new List<Book> { _album })
|
||||
.With(r => r.Author = _otherAuthor)
|
||||
.With(r => r.Books = new List<Book> { _book })
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.Build();
|
||||
|
||||
@@ -106,11 +106,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_false_if_everything_is_the_same()
|
||||
{
|
||||
_artist.QualityProfile.Value.Cutoff = Quality.FLAC.Id;
|
||||
_author.QualityProfile.Value.Cutoff = Quality.FLAC.Id;
|
||||
|
||||
var remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _artist)
|
||||
.With(r => r.Books = new List<Book> { _album })
|
||||
.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)
|
||||
@@ -126,11 +126,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_true_when_quality_in_queue_is_lower()
|
||||
{
|
||||
_artist.QualityProfile.Value.Cutoff = Quality.MP3_320.Id;
|
||||
_author.QualityProfile.Value.Cutoff = Quality.MP3_320.Id;
|
||||
|
||||
var remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _artist)
|
||||
.With(r => r.Books = new List<Book> { _album })
|
||||
.With(r => r.Author = _author)
|
||||
.With(r => r.Books = new List<Book> { _book })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.AZW3)
|
||||
@@ -143,11 +143,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_true_when_album_doesnt_match()
|
||||
public void should_return_true_when_book_doesnt_match()
|
||||
{
|
||||
var remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _artist)
|
||||
.With(r => r.Books = new List<Book> { _otherAlbum })
|
||||
.With(r => r.Author = _author)
|
||||
.With(r => r.Books = new List<Book> { _otherBook })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320)
|
||||
@@ -165,8 +165,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
_remoteBook.PreferredWordScore = 1;
|
||||
|
||||
var remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _artist)
|
||||
.With(r => r.Books = new List<Book> { _album })
|
||||
.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)
|
||||
@@ -182,8 +182,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void should_return_false_when_qualities_are_the_same()
|
||||
{
|
||||
var remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _artist)
|
||||
.With(r => r.Books = new List<Book> { _album })
|
||||
.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)
|
||||
@@ -198,11 +198,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_false_when_quality_in_queue_is_better()
|
||||
{
|
||||
_artist.QualityProfile.Value.Cutoff = Quality.FLAC.Id;
|
||||
_author.QualityProfile.Value.Cutoff = Quality.FLAC.Id;
|
||||
|
||||
var remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _artist)
|
||||
.With(r => r.Books = new List<Book> { _album })
|
||||
.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)
|
||||
@@ -215,11 +215,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_false_if_matching_multi_album_is_in_queue()
|
||||
public void should_return_false_if_matching_multi_book_is_in_queue()
|
||||
{
|
||||
var remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _artist)
|
||||
.With(r => r.Books = new List<Book> { _album, _otherAlbum })
|
||||
.With(r => r.Author = _author)
|
||||
.With(r => r.Books = new List<Book> { _book, _otherBook })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320)
|
||||
@@ -232,11 +232,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_false_if_multi_album_has_one_album_in_queue()
|
||||
public void should_return_false_if_multi_book_has_one_book_in_queue()
|
||||
{
|
||||
var remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _artist)
|
||||
.With(r => r.Books = new List<Book> { _album })
|
||||
.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)
|
||||
@@ -244,18 +244,18 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.Build();
|
||||
|
||||
_remoteBook.Books.Add(_otherAlbum);
|
||||
_remoteBook.Books.Add(_otherBook);
|
||||
|
||||
GivenQueue(new List<RemoteBook> { remoteBook });
|
||||
Subject.IsSatisfiedBy(_remoteBook, null).Accepted.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_false_if_multi_part_album_is_already_in_queue()
|
||||
public void should_return_false_if_multi_part_book_is_already_in_queue()
|
||||
{
|
||||
var remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _artist)
|
||||
.With(r => r.Books = new List<Book> { _album, _otherAlbum })
|
||||
.With(r => r.Author = _author)
|
||||
.With(r => r.Books = new List<Book> { _book, _otherBook })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320)
|
||||
@@ -263,30 +263,30 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.Build();
|
||||
|
||||
_remoteBook.Books.Add(_otherAlbum);
|
||||
_remoteBook.Books.Add(_otherBook);
|
||||
|
||||
GivenQueue(new List<RemoteBook> { remoteBook });
|
||||
Subject.IsSatisfiedBy(_remoteBook, null).Accepted.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_false_if_multi_part_album_has_two_albums_in_queue()
|
||||
public void should_return_false_if_multi_part_book_has_two_books_in_queue()
|
||||
{
|
||||
var remoteBooks = Builder<RemoteBook>.CreateListOfSize(2)
|
||||
.All()
|
||||
.With(r => r.Author = _artist)
|
||||
.With(r => r.Author = _author)
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.MP3_320)
|
||||
})
|
||||
.With(r => r.Release = _releaseInfo)
|
||||
.TheFirst(1)
|
||||
.With(r => r.Books = new List<Book> { _album })
|
||||
.With(r => r.Books = new List<Book> { _book })
|
||||
.TheNext(1)
|
||||
.With(r => r.Books = new List<Book> { _otherAlbum })
|
||||
.With(r => r.Books = new List<Book> { _otherBook })
|
||||
.Build();
|
||||
|
||||
_remoteBook.Books.Add(_otherAlbum);
|
||||
_remoteBook.Books.Add(_otherBook);
|
||||
GivenQueue(remoteBooks);
|
||||
Subject.IsSatisfiedBy(_remoteBook, null).Accepted.Should().BeFalse();
|
||||
}
|
||||
@@ -294,12 +294,12 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_false_when_quality_is_better_and_upgrade_allowed_is_false_for_quality_profile()
|
||||
{
|
||||
_artist.QualityProfile.Value.Cutoff = Quality.FLAC.Id;
|
||||
_artist.QualityProfile.Value.UpgradeAllowed = false;
|
||||
_author.QualityProfile.Value.Cutoff = Quality.FLAC.Id;
|
||||
_author.QualityProfile.Value.UpgradeAllowed = false;
|
||||
|
||||
var remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _artist)
|
||||
.With(r => r.Books = new List<Book> { _album })
|
||||
.With(r => r.Author = _author)
|
||||
.With(r => r.Books = new List<Book> { _book })
|
||||
.With(r => r.ParsedBookInfo = new ParsedBookInfo
|
||||
{
|
||||
Quality = new QualityModel(Quality.FLAC)
|
||||
@@ -314,11 +314,11 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_true_if_everything_is_the_same_for_failed_pending()
|
||||
{
|
||||
_artist.QualityProfile.Value.Cutoff = Quality.FLAC.Id;
|
||||
_author.QualityProfile.Value.Cutoff = Quality.FLAC.Id;
|
||||
|
||||
var remoteBook = Builder<RemoteBook>.CreateNew()
|
||||
.With(r => r.Author = _artist)
|
||||
.With(r => r.Books = new List<Book> { _album })
|
||||
.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)
|
||||
|
||||
Reference in New Issue
Block a user