mirror of
https://github.com/Radarr/Radarr
synced 2024-12-27 02:09:59 +00:00
Fixed multi testcase tests.
This commit is contained in:
parent
87079dcb52
commit
c5c7e1eb76
8 changed files with 29 additions and 37 deletions
|
@ -199,7 +199,7 @@ public void processResults_failed_download_should_not_check_the_rest()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase(0)]
|
[TestCase(0)]
|
||||||
[TestCase(-1)]
|
[TestCase(-1)]
|
||||||
[TestCase(-100)]
|
[TestCase(-100)]
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace NzbDrone.Core.Test
|
||||||
// ReSharper disable InconsistentNaming
|
// ReSharper disable InconsistentNaming
|
||||||
public class EpisodeStatusTest : TestBase
|
public class EpisodeStatusTest : TestBase
|
||||||
{
|
{
|
||||||
[Test]
|
|
||||||
[TestCase(1, false, false, EpisodeStatusType.NotAired)]
|
[TestCase(1, false, false, EpisodeStatusType.NotAired)]
|
||||||
[TestCase(-2, false, false, EpisodeStatusType.Missing)]
|
[TestCase(-2, false, false, EpisodeStatusType.Missing)]
|
||||||
[TestCase(1, true, false, EpisodeStatusType.Ready)]
|
[TestCase(1, true, false, EpisodeStatusType.Ready)]
|
||||||
|
@ -36,7 +36,6 @@ public void no_grab_date(int offsetDays, bool hasEpisodes, bool ignored, Episode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase(1, false, false, EpisodeStatusType.Missing)]
|
[TestCase(1, false, false, EpisodeStatusType.Missing)]
|
||||||
[TestCase(-2, false, false, EpisodeStatusType.Missing)]
|
[TestCase(-2, false, false, EpisodeStatusType.Missing)]
|
||||||
[TestCase(1, true, false, EpisodeStatusType.Ready)]
|
[TestCase(1, true, false, EpisodeStatusType.Ready)]
|
||||||
|
@ -59,7 +58,6 @@ public void old_grab_date(int offsetDays, bool hasEpisodes, bool ignored,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase(1, false, false, EpisodeStatusType.Downloading)]
|
[TestCase(1, false, false, EpisodeStatusType.Downloading)]
|
||||||
[TestCase(-2, false, false, EpisodeStatusType.Downloading)]
|
[TestCase(-2, false, false, EpisodeStatusType.Downloading)]
|
||||||
[TestCase(1, true, false, EpisodeStatusType.Downloading)]
|
[TestCase(1, true, false, EpisodeStatusType.Downloading)]
|
||||||
|
@ -83,7 +81,7 @@ public void recent_grab_date(int offsetDays, bool hasEpisodes, bool ignored,
|
||||||
Assert.AreEqual(status, episode.Status);
|
Assert.AreEqual(status, episode.Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase(1, true, false, EpisodeStatusType.Ignored)]
|
[TestCase(1, true, false, EpisodeStatusType.Ignored)]
|
||||||
[TestCase(-2, true, false, EpisodeStatusType.Ignored)]
|
[TestCase(-2, true, false, EpisodeStatusType.Ignored)]
|
||||||
[TestCase(1, true, true, EpisodeStatusType.Ready)]
|
[TestCase(1, true, true, EpisodeStatusType.Ready)]
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace NzbDrone.Core.Test
|
||||||
// ReSharper disable InconsistentNaming
|
// ReSharper disable InconsistentNaming
|
||||||
public class IndexerTests : TestBase
|
public class IndexerTests : TestBase
|
||||||
{
|
{
|
||||||
[Test]
|
|
||||||
[TestCase("nzbsorg.xml", 0)]
|
[TestCase("nzbsorg.xml", 0)]
|
||||||
[TestCase("nzbsrus.xml", 6)]
|
[TestCase("nzbsrus.xml", 6)]
|
||||||
[TestCase("newzbin.xml", 1)]
|
[TestCase("newzbin.xml", 1)]
|
||||||
|
@ -90,7 +90,7 @@ public void newzbin_rss_fetch()
|
||||||
ExceptionVerification.ExcpectedWarns(1);
|
ExceptionVerification.ExcpectedWarns(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("Adventure.Inc.S03E19.DVDRip.XviD-OSiTV", 3, 19, QualityTypes.DVD)]
|
[TestCase("Adventure.Inc.S03E19.DVDRip.XviD-OSiTV", 3, 19, QualityTypes.DVD)]
|
||||||
public void custome_parser_partial_success(string title, int season, int episode, QualityTypes quality)
|
public void custome_parser_partial_success(string title, int season, int episode, QualityTypes quality)
|
||||||
{
|
{
|
||||||
|
@ -117,7 +117,7 @@ public void custome_parser_partial_success(string title, int season, int episode
|
||||||
Assert.AreEqual(quality, result.Quality.QualityType);
|
Assert.AreEqual(quality, result.Quality.QualityType);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("Adventure.Inc.DVDRip.XviD-OSiTV")]
|
[TestCase("Adventure.Inc.DVDRip.XviD-OSiTV")]
|
||||||
public void custome_parser_full_parse(string title)
|
public void custome_parser_full_parse(string title)
|
||||||
{
|
{
|
||||||
|
|
|
@ -205,7 +205,6 @@ public void IsQualityNeeded_file_not_in_history_should_be_downloaded()
|
||||||
}
|
}
|
||||||
|
|
||||||
//Should Download
|
//Should Download
|
||||||
[Test]
|
|
||||||
[TestCase(QualityTypes.SDTV, true, QualityTypes.HDTV, false, true)]
|
[TestCase(QualityTypes.SDTV, true, QualityTypes.HDTV, false, true)]
|
||||||
[TestCase(QualityTypes.DVD, true, QualityTypes.Bluray720p, true, true)]
|
[TestCase(QualityTypes.DVD, true, QualityTypes.Bluray720p, true, true)]
|
||||||
[TestCase(QualityTypes.HDTV, false, QualityTypes.HDTV, true, true)]
|
[TestCase(QualityTypes.HDTV, false, QualityTypes.HDTV, true, true)]
|
||||||
|
|
|
@ -18,10 +18,6 @@ public class ParserTest : TestBase
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("Sonny.With.a.Chance.S02E15", "Sonny.With.a.Chance", 2, 15)]
|
[TestCase("Sonny.With.a.Chance.S02E15", "Sonny.With.a.Chance", 2, 15)]
|
||||||
[TestCase("Two.and.a.Half.Me.103.720p.HDTV.X264-DIMENSION", "Two.and.a.Half.Me", 1, 3)]
|
[TestCase("Two.and.a.Half.Me.103.720p.HDTV.X264-DIMENSION", "Two.and.a.Half.Me", 1, 3)]
|
||||||
[TestCase("Two.and.a.Half.Me.113.720p.HDTV.X264-DIMENSION", "Two.and.a.Half.Me", 1, 13)]
|
[TestCase("Two.and.a.Half.Me.113.720p.HDTV.X264-DIMENSION", "Two.and.a.Half.Me", 1, 13)]
|
||||||
|
@ -67,7 +63,6 @@ public void file_path_parse(string path, int season, int episode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", QualityTypes.DVD)]
|
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", QualityTypes.DVD)]
|
||||||
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.X-viD.AC3.-HELLYWOOD", QualityTypes.DVD)]
|
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.X-viD.AC3.-HELLYWOOD", QualityTypes.DVD)]
|
||||||
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.AC3.-HELLYWOOD", QualityTypes.DVD)]
|
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.AC3.-HELLYWOOD", QualityTypes.DVD)]
|
||||||
|
@ -127,7 +122,7 @@ public void parsing_our_own_quality_enum()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[Timeout(1000)]
|
[Timeout(1000)]
|
||||||
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", "WEEDS", 3, new[] { 1, 2, 3, 4, 5, 6 }, 6)]
|
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", "WEEDS", 3, new[] { 1, 2, 3, 4, 5, 6 }, 6)]
|
||||||
[TestCase("Two.and.a.Half.Men.103.104.720p.HDTV.X264-DIMENSION", "Two.and.a.Half.Men", 1, new[] { 3, 4 }, 2)]
|
[TestCase("Two.and.a.Half.Men.103.104.720p.HDTV.X264-DIMENSION", "Two.and.a.Half.Men", 1, new[] { 3, 4 }, 2)]
|
||||||
|
@ -147,7 +142,7 @@ public void episode_multipart_parse(string postTitle, string title, int season,
|
||||||
Assert.AreEqual(count, result.EpisodeNumbers.Count);
|
Assert.AreEqual(count, result.EpisodeNumbers.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("Conan 2011 04 18 Emma Roberts HDTV XviD BFF", "Conan", 2011, 04, 18)]
|
[TestCase("Conan 2011 04 18 Emma Roberts HDTV XviD BFF", "Conan", 2011, 04, 18)]
|
||||||
[TestCase("The Tonight Show With Jay Leno 2011 04 15 1080i HDTV DD5 1 MPEG2 TrollHD", "The Tonight Show With Jay Leno", 2011, 04, 15)]
|
[TestCase("The Tonight Show With Jay Leno 2011 04 15 1080i HDTV DD5 1 MPEG2 TrollHD", "The Tonight Show With Jay Leno", 2011, 04, 15)]
|
||||||
[TestCase("The.Daily.Show.2010.10.11.Johnny.Knoxville.iTouch-MW", "The.Daily.Show", 2010, 10, 11)]
|
[TestCase("The.Daily.Show.2010.10.11.Johnny.Knoxville.iTouch-MW", "The.Daily.Show", 2010, 10, 11)]
|
||||||
|
@ -164,7 +159,7 @@ public void episode_daily_parse(string postTitle, string title, int year, int mo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("30.Rock.Season.04.HDTV.XviD-DIMENSION", "30.Rock", 4)]
|
[TestCase("30.Rock.Season.04.HDTV.XviD-DIMENSION", "30.Rock", 4)]
|
||||||
[TestCase("Parks.and.Recreation.S02.720p.x264-DIMENSION", "Parks.and.Recreation", 2)]
|
[TestCase("Parks.and.Recreation.S02.720p.x264-DIMENSION", "Parks.and.Recreation", 2)]
|
||||||
[TestCase("The.Office.US.S03.720p.x264-DIMENSION", "The.Office.US", 3)]
|
[TestCase("The.Office.US.S03.720p.x264-DIMENSION", "The.Office.US", 3)]
|
||||||
|
@ -176,7 +171,7 @@ public void full_season_release_parse(string postTitle, string title, int season
|
||||||
Assert.AreEqual(0, result.EpisodeNumbers.Count);
|
Assert.AreEqual(0, result.EpisodeNumbers.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("Conan", "conan")]
|
[TestCase("Conan", "conan")]
|
||||||
[TestCase("The Tonight Show With Jay Leno", "tonightshowwithjayleno")]
|
[TestCase("The Tonight Show With Jay Leno", "tonightshowwithjayleno")]
|
||||||
[TestCase("The.Daily.Show", "dailyshow")]
|
[TestCase("The.Daily.Show", "dailyshow")]
|
||||||
|
@ -188,7 +183,7 @@ public void series_name_normalize(string parsedSeriesName, string seriesName)
|
||||||
Assert.AreEqual(seriesName, result);
|
Assert.AreEqual(seriesName, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase(@"c:\test\", @"c:\test")]
|
[TestCase(@"c:\test\", @"c:\test")]
|
||||||
[TestCase(@"c:\\test\\", @"c:\test")]
|
[TestCase(@"c:\\test\\", @"c:\test")]
|
||||||
[TestCase(@"C:\\Test\\", @"C:\Test")]
|
[TestCase(@"C:\\Test\\", @"C:\Test")]
|
||||||
|
@ -200,7 +195,7 @@ public void Normalize_Path(string dirty, string clean)
|
||||||
Assert.AreEqual(clean, result);
|
Assert.AreEqual(clean, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("CaPitAl", "capital")]
|
[TestCase("CaPitAl", "capital")]
|
||||||
[TestCase("peri.od", "period")]
|
[TestCase("peri.od", "period")]
|
||||||
[TestCase("this.^&%^**$%@#$!That", "thisthat")]
|
[TestCase("this.^&%^**$%@#$!That", "thisthat")]
|
||||||
|
@ -210,7 +205,7 @@ public void Normalize_Title(string dirty, string clean)
|
||||||
Assert.AreEqual(clean, result);
|
Assert.AreEqual(clean, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("the")]
|
[TestCase("the")]
|
||||||
[TestCase("and")]
|
[TestCase("and")]
|
||||||
[TestCase("or")]
|
[TestCase("or")]
|
||||||
|
@ -240,7 +235,7 @@ public void Normalize_removed_common_words(string word)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("the")]
|
[TestCase("the")]
|
||||||
[TestCase("and")]
|
[TestCase("and")]
|
||||||
[TestCase("or")]
|
[TestCase("or")]
|
||||||
|
|
|
@ -259,7 +259,7 @@ public void IsInQueue_False_Error()
|
||||||
mocker.Resolve<SabProvider>().IsInQueue(String.Empty);
|
mocker.Resolve<SabProvider>().IsInQueue(String.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase(1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, false, "My Series Name - 1x2 - My Episode Title [DVD]")]
|
[TestCase(1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, false, "My Series Name - 1x2 - My Episode Title [DVD]")]
|
||||||
[TestCase(1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, true, "My Series Name - 1x2 - My Episode Title [DVD] [Proper]")]
|
[TestCase(1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, true, "My Series Name - 1x2 - My Episode Title [DVD] [Proper]")]
|
||||||
[TestCase(1, new[] { 2 }, "", QualityTypes.DVD, true, "My Series Name - 1x2 - [DVD] [Proper]")]
|
[TestCase(1, new[] { 2 }, "", QualityTypes.DVD, true, "My Series Name - 1x2 - [DVD] [Proper]")]
|
||||||
|
|
Binary file not shown.
|
@ -31,11 +31,11 @@ public virtual List<RootDir> GetAll()
|
||||||
return _repository.All<RootDir>().ToList();
|
return _repository.All<RootDir>().ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Add(RootDir rootDir)
|
public virtual int Add(RootDir rootDir)
|
||||||
{
|
{
|
||||||
ValidatePath(rootDir);
|
ValidatePath(rootDir);
|
||||||
|
|
||||||
_repository.Add(rootDir);
|
return (int)_repository.Add(rootDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Remove(int rootDirId)
|
public virtual void Remove(int rootDirId)
|
||||||
|
|
Loading…
Reference in a new issue