mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-23 22:25:09 -04:00
Rework Tests for Music, Start TV Code Cleanup
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Music;
|
||||
|
||||
namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class GetArtistFixture : CoreTest<ParsingService>
|
||||
{
|
||||
[Test]
|
||||
public void should_use_passed_in_title_when_it_cannot_be_parsed()
|
||||
{
|
||||
const string title = "30 Rock";
|
||||
|
||||
Subject.GetArtist(title);
|
||||
|
||||
Mocker.GetMock<IArtistService>()
|
||||
.Verify(s => s.FindByName(title), Times.Once());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_use_parsed_artist_title()
|
||||
{
|
||||
const string title = "30 Rock - Get Some [FLAC]";
|
||||
|
||||
Subject.GetArtist(title);
|
||||
|
||||
Mocker.GetMock<IArtistService>()
|
||||
.Verify(s => s.FindByName(Parser.Parser.ParseAlbumTitle(title).ArtistName), Times.Once());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Tv;
|
||||
|
||||
namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class GetSeriesFixture : CoreTest<ParsingService>
|
||||
{
|
||||
[Test]
|
||||
public void should_use_passed_in_title_when_it_cannot_be_parsed()
|
||||
{
|
||||
const string title = "30 Rock";
|
||||
|
||||
Subject.GetSeries(title);
|
||||
|
||||
Mocker.GetMock<ISeriesService>()
|
||||
.Verify(s => s.FindByTitle(title), Times.Once());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_use_parsed_series_title()
|
||||
{
|
||||
const string title = "30.Rock.S01E01.720p.hdtv";
|
||||
|
||||
Subject.GetSeries(title);
|
||||
|
||||
Mocker.GetMock<ISeriesService>()
|
||||
.Verify(s => s.FindByTitle(Parser.Parser.ParseTitle(title).SeriesTitle), Times.Once());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_fallback_to_title_without_year_and_year_when_title_lookup_fails()
|
||||
{
|
||||
const string title = "House.2004.S01E01.720p.hdtv";
|
||||
var parsedEpisodeInfo = Parser.Parser.ParseTitle(title);
|
||||
|
||||
Subject.GetSeries(title);
|
||||
|
||||
Mocker.GetMock<ISeriesService>()
|
||||
.Verify(s => s.FindByTitle(parsedEpisodeInfo.SeriesTitleInfo.TitleWithoutYear,
|
||||
parsedEpisodeInfo.SeriesTitleInfo.Year), Times.Once());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user