mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Moved GetSabTitle from episodeprovider to sabprovider, removed seriesprovider dependency
This commit is contained in:
parent
3beeff4e18
commit
217f98c4a9
6 changed files with 74 additions and 69 deletions
|
@ -1,9 +1,14 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using AutoMoq;
|
||||
using MbUnit.Framework;
|
||||
using Moq;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Providers.Core;
|
||||
using NzbDrone.Core.Repository;
|
||||
using NzbDrone.Core.Repository.Quality;
|
||||
|
||||
namespace NzbDrone.Core.Test
|
||||
{
|
||||
|
@ -194,5 +199,35 @@ namespace NzbDrone.Core.Test
|
|||
//Assert
|
||||
Assert.AreEqual(false, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Row(1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, false, "My Series Name - 1x2 - My Episode Title DVD")]
|
||||
[Row(1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, true, "My Series Name - 1x2 - My Episode Title DVD [Proper]")]
|
||||
[Row(1, new[] { 2 }, "", QualityTypes.DVD, true, "My Series Name - 1x2 - DVD [Proper]")]
|
||||
[Row(1, new[] { 2, 4 }, "My Episode Title", QualityTypes.HDTV, false, "My Series Name - 1x2-1x4 - My Episode Title HDTV")]
|
||||
[Row(1, new[] { 2, 4 }, "My Episode Title", QualityTypes.HDTV, true, "My Series Name - 1x2-1x4 - My Episode Title HDTV [Proper]")]
|
||||
[Row(1, new[] { 2, 4 }, "", QualityTypes.HDTV, true, "My Series Name - 1x2-1x4 - HDTV [Proper]")]
|
||||
public void sab_title(int seasons, int[] episodes, string title, QualityTypes quality, bool proper, string excpected)
|
||||
{
|
||||
var mocker = new AutoMoqer();
|
||||
|
||||
var parsResult = new EpisodeParseResult()
|
||||
{
|
||||
SeriesId = 12,
|
||||
AirDate = DateTime.Now,
|
||||
Episodes = episodes.ToList(),
|
||||
Proper = proper,
|
||||
Quality = quality,
|
||||
SeasonNumber = seasons,
|
||||
EpisodeTitle = title,
|
||||
FolderName = "My Series Name"
|
||||
};
|
||||
|
||||
//Act
|
||||
var actual = mocker.Resolve<SabProvider>().GetSabTitle(parsResult);
|
||||
|
||||
//Assert
|
||||
Assert.AreEqual(excpected, actual);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue