mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-26 22:46:37 -04:00
Cleanup Conflicts in Sonarr/Lidarr Pulls
Co-Authored-By: Robin Dadswell <19610103+RobinDadswell@users.noreply.github.com>
This commit is contained in:
+9
-9
@@ -7,26 +7,26 @@ using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Books;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.MusicTests.ArtistRepositoryTests
|
||||
namespace NzbDrone.Core.Test.MusicTests.AuthorRepositoryTests
|
||||
{
|
||||
[TestFixture]
|
||||
|
||||
public class ArtistMetadataRepositoryFixture : DbTest<AuthorMetadataRepository, AuthorMetadata>
|
||||
public class AuthorMetadataRepositoryFixture : DbTest<AuthorMetadataRepository, AuthorMetadata>
|
||||
{
|
||||
private AuthorMetadataRepository _artistMetadataRepo;
|
||||
private AuthorMetadataRepository _authorMetadataRepo;
|
||||
private List<AuthorMetadata> _metadataList;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
_artistMetadataRepo = Mocker.Resolve<AuthorMetadataRepository>();
|
||||
_authorMetadataRepo = Mocker.Resolve<AuthorMetadataRepository>();
|
||||
_metadataList = Builder<AuthorMetadata>.CreateListOfSize(10).All().With(x => x.Id = 0).BuildList();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void upsert_many_should_insert_list_of_new()
|
||||
{
|
||||
var updated = _artistMetadataRepo.UpsertMany(_metadataList);
|
||||
var updated = _authorMetadataRepo.UpsertMany(_metadataList);
|
||||
AllStoredModels.Should().HaveCount(_metadataList.Count);
|
||||
updated.Should().BeTrue();
|
||||
}
|
||||
@@ -35,12 +35,12 @@ namespace NzbDrone.Core.Test.MusicTests.ArtistRepositoryTests
|
||||
public void upsert_many_should_upsert_existing_with_id_0()
|
||||
{
|
||||
var clone = _metadataList.JsonClone();
|
||||
var updated = _artistMetadataRepo.UpsertMany(clone);
|
||||
var updated = _authorMetadataRepo.UpsertMany(clone);
|
||||
|
||||
updated.Should().BeTrue();
|
||||
AllStoredModels.Should().HaveCount(_metadataList.Count);
|
||||
|
||||
updated = _artistMetadataRepo.UpsertMany(_metadataList);
|
||||
updated = _authorMetadataRepo.UpsertMany(_metadataList);
|
||||
updated.Should().BeFalse();
|
||||
AllStoredModels.Should().HaveCount(_metadataList.Count);
|
||||
}
|
||||
@@ -49,12 +49,12 @@ namespace NzbDrone.Core.Test.MusicTests.ArtistRepositoryTests
|
||||
public void upsert_many_should_upsert_mixed_list_of_old_and_new()
|
||||
{
|
||||
var clone = _metadataList.Take(5).ToList().JsonClone();
|
||||
var updated = _artistMetadataRepo.UpsertMany(clone);
|
||||
var updated = _authorMetadataRepo.UpsertMany(clone);
|
||||
|
||||
updated.Should().BeTrue();
|
||||
AllStoredModels.Should().HaveCount(clone.Count);
|
||||
|
||||
updated = _artistMetadataRepo.UpsertMany(_metadataList);
|
||||
updated = _authorMetadataRepo.UpsertMany(_metadataList);
|
||||
updated.Should().BeTrue();
|
||||
AllStoredModels.Should().HaveCount(_metadataList.Count);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user