You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readarr/src/NzbDrone.Core.Test/MediaFiles/TrackImport/Identification/CandidateServiceFixture.cs

42 lines
1.3 KiB

using System.Collections.Generic;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.MediaFiles.BookImport.Identification;
using NzbDrone.Core.MetadataSource;
using NzbDrone.Core.MetadataSource.Goodreads;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.MediaFiles.BookImport.Identification
{
[TestFixture]
public class CandidateServiceFixture : CoreTest<CandidateService>
{
[Test]
public void should_not_throw_on_goodreads_exception()
{
Mocker.GetMock<ISearchForNewBook>()
.Setup(s => s.SearchForNewBook(It.IsAny<string>(), It.IsAny<string>(), true))
.Throws(new GoodreadsException("Bad search"));
var edition = new LocalEdition
{
LocalBooks = new List<LocalBook>
{
new LocalBook
{
FileTrackInfo = new ParsedTrackInfo
{
Authors = new List<string> { "Author" },
BookTitle = "Book"
}
}
}
};
Subject.GetRemoteCandidates(edition, null).Should().BeEmpty();
}
}
}