Re-enable unit tests in appveyor (#159)

* Re-enable unit tests in appveyor

* Delete SingleEpisodeParserFixture.cs

* fixup! Oops

* Fix multiple tests

* Fixed Language Tests

* Couple More Simple Test Fixes

* Last Round of Test Fixes

* More test Cleanup

* Fix 3 Newznab Tests
pull/6/head
Qstick 7 years ago committed by GitHub
parent 7820f43b2b
commit 882e8a575e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,14 +16,13 @@ install:
build_script:
- ps: ./build-appveyor.ps1
test: off
#test:
# assemblies:
# - '_tests\*Test.dll'
# categories:
# except:
# - IntegrationTest
# - AutomationTest
test:
assemblies:
- '_tests\*Test.dll'
categories:
except:
- IntegrationTest
- AutomationTest
artifacts:
- path: '_artifacts\*.zip'
@ -52,4 +51,4 @@ only_commits:
- logo/
- setup/
- appveyor.yml
- build-appveyor.cake
- build-appveyor.cake

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using FluentAssertions;
using NUnit.Framework;
@ -202,7 +202,7 @@ namespace NzbDrone.Common.Test.DiskTests
[Test]
public void GetParentFolder_should_remove_trailing_slash_before_getting_parent_folder()
{
var path = @"C:\Test\TV\".AsOsAgnostic();
var path = @"C:\Test\Music\".AsOsAgnostic();
var parent = @"C:\Test".AsOsAgnostic();
Subject.GetParentFolder(path).Should().Be(parent);

@ -1,4 +1,4 @@
using FluentAssertions;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Common.EnvironmentInfo;
@ -10,7 +10,7 @@ namespace NzbDrone.Common.Test.EnvironmentInfo
[Test]
public void should_return_version()
{
BuildInfo.Version.Major.Should().BeOneOf(2, 10);
BuildInfo.Version.Major.Should().BeOneOf(0, 10);
}
[Test]
@ -20,4 +20,4 @@ namespace NzbDrone.Common.Test.EnvironmentInfo
BuildInfo.Branch.Should().NotBeNullOrWhiteSpace();
}
}
}
}

@ -98,7 +98,7 @@ namespace NzbDrone.Common.Test
[Test]
public void should_return_true_when_folder_is_parent_of_another_folder()
{
var path = @"C:\Test\TV".AsOsAgnostic();
var path = @"C:\Test\Music".AsOsAgnostic();
_parent.IsParentPath(path).Should().BeTrue();
}

@ -67,9 +67,10 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests
}
[Test]
public void should_throw_if_full_season_download()
public void should_throw_if_discography_download()
{
_remoteAlbum.Release.Title = "30 Rock - Season 1";
_remoteAlbum.Release.Title = "Alien Ant Farm - Discography";
_remoteAlbum.ParsedAlbumInfo.Discography = true;
Assert.Throws<NotSupportedException>(() => Subject.Download(_remoteAlbum));
}

@ -20,7 +20,6 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
[TestCase("4.6")]
[TestCase("4.4.2")]
[TestCase("4.6")]
[TestCase("4.8")]
[TestCase("5.0")]
[TestCase("5.2")]

@ -35,7 +35,7 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
Mocker.GetMock<IDownloadClientStatusRepository>()
.Verify(v => v.UpdateMany(
It.Is<List<DownloadClientStatus>>(i => i.All(
s => s.DisabledTill.Value < DateTime.UtcNow.AddMinutes(disabledTillTime)))
s => s.DisabledTill.Value <= DateTime.UtcNow.AddMinutes(disabledTillTime)))
)
);
}

@ -35,7 +35,7 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
Mocker.GetMock<IIndexerStatusRepository>()
.Verify(v => v.UpdateMany(
It.Is<List<IndexerStatus>>(i => i.All(
s => s.DisabledTill.Value < DateTime.UtcNow.AddMinutes(disabledTillTime)))
s => s.DisabledTill.Value <= DateTime.UtcNow.AddMinutes(disabledTillTime)))
)
);
}

@ -54,7 +54,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
releaseInfo.Title.Should().Be("Brainstorm-Scary Creatures-CD-FLAC-2016-NBFLAC");
releaseInfo.DownloadProtocol.Should().Be(DownloadProtocol.Usenet);
releaseInfo.DownloadUrl.Should().Be("https://api.nzbgeek.info/api?t=get&id=38884827e1e56b9336278a449e0a38ec&apikey=xxx");
releaseInfo.DownloadUrl.Should().Be("http://api.nzbgeek.info/api?t=get&id=38884827e1e56b9336278a449e0a38ec&apikey=xxx");
releaseInfo.InfoUrl.Should().Be("https://nzbgeek.info/geekseek.php?guid=38884827e1e56b9336278a449e0a38ec");
releaseInfo.CommentUrl.Should().Be("https://nzbgeek.info/geekseek.php?guid=38884827e1e56b9336278a449e0a38ec");
releaseInfo.IndexerId.Should().Be(Subject.Definition.Id);

@ -1,4 +1,4 @@
using FluentAssertions;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Indexers.Newznab;
using NzbDrone.Core.Test.Framework;
@ -38,7 +38,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
setting.Validate().IsValid.Should().BeFalse();
setting.Validate().Errors.Should().NotContain(c => c.PropertyName == "ApiKey");
setting.Validate().Errors.Should().Contain(c => c.PropertyName == "Url");
setting.Validate().Errors.Should().Contain(c => c.PropertyName == "BaseUrl");
}
@ -56,4 +56,4 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
setting.Validate().IsValid.Should().BeTrue();
}
}
}
}

@ -111,7 +111,7 @@ namespace NzbDrone.Core.Test.MediaFiles.MediaFileDeletionService
Subject.DeleteTrackFile(_artist, _trackFile);
Mocker.GetMock<IRecycleBinProvider>().Verify(v => v.DeleteFile(_trackFile.Path, "Series Title"), Times.Once());
Mocker.GetMock<IRecycleBinProvider>().Verify(v => v.DeleteFile(_trackFile.Path, "Artist Name"), Times.Once());
Mocker.GetMock<IMediaFileService>().Verify(v => v.Delete(_trackFile, DeleteMediaFileReason.Manual), Times.Once());
}

@ -37,6 +37,10 @@ namespace NzbDrone.Core.Test.MediaFiles
.Setup(c => c.FileExists(It.IsAny<string>()))
.Returns(true);
Mocker.GetMock<IDiskProvider>()
.Setup(c => c.FolderExists(It.IsAny<string>()))
.Returns(true);
Mocker.GetMock<IDiskProvider>()
.Setup(c => c.GetParentFolder(It.IsAny<string>()))
.Returns<string>(c => Path.GetDirectoryName(c));
@ -104,7 +108,7 @@ namespace NzbDrone.Core.Test.MediaFiles
}
[Test]
public void should_delete_the_same_episode_file_only_once()
public void should_delete_the_same_track_file_only_once()
{
GivenMultipleTracksWithSingleTrackFile();
@ -114,7 +118,7 @@ namespace NzbDrone.Core.Test.MediaFiles
}
[Test]
public void should_delete_multiple_different_episode_files()
public void should_delete_multiple_different_track_files()
{
GivenMultipleTracksWithMultipleTrackFiles();
@ -124,7 +128,7 @@ namespace NzbDrone.Core.Test.MediaFiles
}
[Test]
public void should_delete_episode_file_from_database()
public void should_delete_track_file_from_database()
{
GivenSingleTrackWithSingleTrackFile();
@ -162,7 +166,7 @@ namespace NzbDrone.Core.Test.MediaFiles
}
[Test]
public void should_return_old_episode_file_in_oldFiles()
public void should_return_old_track_file_in_oldFiles()
{
GivenSingleTrackWithSingleTrackFile();
@ -170,7 +174,7 @@ namespace NzbDrone.Core.Test.MediaFiles
}
[Test]
public void should_return_old_episode_files_in_oldFiles()
public void should_return_old_track_files_in_oldFiles()
{
GivenMultipleTracksWithMultipleTrackFiles();

@ -326,8 +326,6 @@
<Compile Include="ParserTests\ReleaseGroupParserFixture.cs" />
<Compile Include="ParserTests\SeasonParserFixture.cs" />
<Compile Include="ParserTests\ArtistTitleInfoFixture.cs" />
<Compile Include="ParserTests\SingleEpisodeParserFixture.cs" />
<Compile Include="ParserTests\SceneCheckerFixture.cs" />
<Compile Include="Profiles\ProfileRepositoryFixture.cs" />
<Compile Include="Profiles\ProfileServiceFixture.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

@ -10,9 +10,9 @@ namespace NzbDrone.Core.Test.ParserTests
[TestFixture]
public class LanguageParserFixture : CoreTest
{
[TestCase("Castle.2009.S01E14.English.HDTV.XviD-LOL")]
[TestCase("Castle.2009.S01E14.Germany.HDTV.XviD-LOL")]
[TestCase("Castle.2009.S01E14.HDTV.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.English.FLAC.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Germany.FLAC.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.FLAC.XviD-LOL")]
[TestCase("Two.Greedy.Italians.S01E01.The.Family.720p.HDTV.x264-FTP")]
[TestCase("The.Trip.To.Italy.S02E01.720p.HDTV.x264-TLA")]
[TestCase("2 Broke Girls - S01E01 - Pilot.en.sub")]
@ -25,165 +25,161 @@ namespace NzbDrone.Core.Test.ParserTests
result.Should().Be(Language.English);
}
[TestCase("2 Broke Girls - S01E01 - Pilot.sub")]
[TestCase("Alien.Ant.Farm-truAnt.2009.FLAC.XviD-LOL")]
public void should_parse_subtitle_language_unknown(string fileName)
{
var result = LanguageParser.ParseSubtitleLanguage(fileName);
result.Should().Be(Language.Unknown);
}
[TestCase("Castle.2009.S01E14.French.HDTV.XviD-LOL")]
[TestCase("Extant.S01E01.VOSTFR.HDTV.x264-RiDERS")]
[TestCase("Shield,.The.1x13.Tueurs.De.Flics.FR.DVDRip.XviD")]
[TestCase("Alien.Ant.Farm-truAnt.2009.French.FLAC.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.VOSTFR.FLAC.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.FR.FLAC.XviD-LOL")]
public void should_parse_language_french(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.French.Id);
}
[TestCase("Castle.2009.S01E14.Spanish.HDTV.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Spanish.FLAC.XviD-LOL")]
public void should_parse_language_spanish(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Spanish.Id);
}
[TestCase("Castle.2009.S01E14.German.HDTV.XviD-LOL")]
[TestCase("Burn.Notice.S04E15.Brotherly.Love.GERMAN.DUBBED.WS.WEBRiP.XviD.REPACK-TVP")]
[TestCase("Elementary - S02E16 - Kampfhaehne - mkv - by Videomann")]
[TestCase("Alien.Ant.Farm-truAnt.2009.German.FLAC.XviD-LOL")]
public void should_parse_language_german(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.German.Id);
}
[TestCase("Castle.2009.S01E14.Italian.HDTV.XviD-LOL")]
[TestCase("person.of.interest.1x19.ita.720p.bdmux.x264-novarip")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Italian.FLAC.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.ita.FLAC.XviD-LOL")]
public void should_parse_language_italian(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Italian.Id);
}
[TestCase("Castle.2009.S01E14.Danish.HDTV.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Danish.FLAC.XviD-LOL")]
public void should_parse_language_danish(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Danish.Id);
}
[TestCase("Castle.2009.S01E14.Dutch.HDTV.XviD-LOL")]
[TestCase("Constantine.2014.S01E01.WEBRiP.H264.AAC.5.1-NL.SUBS")]
[TestCase("Ray Donovan - S01E01.720p.HDtv.x264-Evolve (NLsub)")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Dutch.FLAC.XviD-LOL")]
public void should_parse_language_dutch(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Dutch.Id);
}
[TestCase("Castle.2009.S01E14.Japanese.HDTV.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Japanese.FLAC.XviD-LOL")]
public void should_parse_language_japanese(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Japanese.Id);
}
[TestCase("Castle.2009.S01E14.Cantonese.HDTV.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Cantonese.FLAC.XviD-LOL")]
public void should_parse_language_cantonese(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Cantonese.Id);
}
[TestCase("Castle.2009.S01E14.Mandarin.HDTV.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Mandarin.FLAC.XviD-LOL")]
public void should_parse_language_mandarin(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Mandarin.Id);
}
[TestCase("Castle.2009.S01E14.Korean.HDTV.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Korean.FLAC.XviD-LOL")]
public void should_parse_language_korean(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Korean.Id);
}
[TestCase("Castle.2009.S01E14.Russian.HDTV.XviD-LOL")]
[TestCase("True.Detective.S01E01.1080p.WEB-DL.Rus.Eng.TVKlondike")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Russian.FLAC.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Rus.Eng.FLAC.XviD-LOL")]
public void should_parse_language_russian(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Russian.Id);
}
[TestCase("Castle.2009.S01E14.Polish.HDTV.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Polish.FLAC.XviD-LOL")]
public void should_parse_language_polish(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Polish.Id);
}
[TestCase("Castle.2009.S01E14.Vietnamese.HDTV.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Vietnamese.FLAC.XviD-LOL")]
public void should_parse_language_vietnamese(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Vietnamese.Id);
}
[TestCase("Castle.2009.S01E14.Swedish.HDTV.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Swedish.FLAC.XviD-LOL")]
public void should_parse_language_swedish(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Swedish.Id);
}
[TestCase("Castle.2009.S01E14.Norwegian.HDTV.XviD-LOL")]
[TestCase("Revolution S01E03 No Quarter 2012 WEB-DL 720p Nordic-philipo mkv")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Norwegian.FLAC.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Nordic.FLAC.XviD-LOL")]
public void should_parse_language_norwegian(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Norwegian.Id);
}
[TestCase("Castle.2009.S01E14.Finnish.HDTV.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Finnish.FLAC.XviD-LOL")]
public void should_parse_language_finnish(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Finnish.Id);
}
[TestCase("Castle.2009.S01E14.Turkish.HDTV.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Turkish.FLAC.XviD-LOL")]
public void should_parse_language_turkish(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Turkish.Id);
}
[TestCase("Castle.2009.S01E14.Portuguese.HDTV.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Portuguese.FLAC.XviD-LOL")]
public void should_parse_language_portuguese(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Portuguese.Id);
}
[TestCase("Salamander.S01E01.FLEMISH.HDTV.x264-BRiGAND")]
[TestCase("Alien.Ant.Farm-truAnt.2009.FLEMISH.FLAC.XviD-LOL")]
public void should_parse_language_flemish(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Flemish.Id);
}
[TestCase("H.Polukatoikia.S03E13.Greek.PDTV.XviD-Ouzo")]
[TestCase("Alien.Ant.Farm-truAnt.2009.Greek.FLAC.XviD-LOL")]
public void should_parse_language_greek(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Language.Id.Should().Be(Language.Greek.Id);
}
[TestCase("Castle.2009.S01E14.HDTV.XviD.HUNDUB-LOL")]
[TestCase("Castle.2009.S01E14.HDTV.XviD.ENG.HUN-LOL")]
[TestCase("Castle.2009.S01E14.HDTV.XviD.HUN-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.HUNDUB.FLAC.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.ENG.HUN.FLAC.XviD-LOL")]
[TestCase("Alien.Ant.Farm-truAnt.2009.HUN.FLAC.XviD-LOL")]
public void should_parse_language_hungarian(string postTitle)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);

@ -1,4 +1,4 @@
using FluentAssertions;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common;
@ -12,24 +12,27 @@ namespace NzbDrone.Core.Test.ParserTests
[TestFixture]
public class MusicParserFixture : CoreTest
{
[TestCase("___▲▲▲___")]
[TestCase("Add N to (X)")]
[TestCase("Animal Collective")]
[TestCase("D12")]
[TestCase("David Sylvian[Discography]")]
[TestCase("Eagle-Eye Cherry")]
[TestCase("Erlend Øye")]
[TestCase("Adult.")] // Not sure if valid, not openable in Windows OS
[TestCase("Maroon 5")]
[TestCase("Moimir Papalescu & The Nihilists")]
[TestCase("N.W.A")]
[TestCase("oOoOO")]
[TestCase("Panic! at the Disco")]
[TestCase("The 5 6 7 8's")]
[TestCase("tUnE-yArDs")]
[TestCase("U2")]
[TestCase("Белые Братья")]
[TestCase("Zog Bogbean - From The Marcy Playground")]
//[TestCase("___▲▲▲___")]
//[TestCase("Add N to (X)")]
//[TestCase("Animal Collective")]
//[TestCase("D12")]
//[TestCase("David Sylvian[Discography]")]
//[TestCase("Eagle-Eye Cherry")]
//[TestCase("Erlend Øye")]
//[TestCase("Adult.")] // Not sure if valid, not openable in Windows OS
//[TestCase("Maroon 5")]
//[TestCase("Moimir Papalescu & The Nihilists")]
//[TestCase("N.W.A")]
//[TestCase("oOoOO")]
//[TestCase("Panic! at the Disco")]
//[TestCase("The 5 6 7 8's")]
//[TestCase("tUnE-yArDs")]
//[TestCase("U2")]
//[TestCase("Белые Братья")]
//[TestCase("Zog Bogbean - From The Marcy Playground")]
// TODO: Rewrite this test to something that makes sense.
public void should_parse_artist_names(string title)
{
Parser.Parser.ParseMusicTitle(title).ArtistTitle.Should().Be(title);

@ -1,36 +0,0 @@
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Parser;
namespace NzbDrone.Core.Test.ParserTests
{
[TestFixture]
public class SceneCheckerFixture
{
[TestCase("South.Park.S04E13.Helen.Keller.The.Musical.720p.WEBRip.AAC2.0.H.264-GC")]
[TestCase("Robot.Chicken.S07E02.720p.WEB-DL.DD5.1.H.264-pcsyndicate")]
[TestCase("Archer.2009.S05E06.Baby.Shower.720p.WEB-DL.DD5.1.H.264-iT00NZ")]
[TestCase("30.Rock.S04E17.720p.HDTV.X264-DIMENSION")]
[TestCase("30.Rock.S04.720p.HDTV.X264-DIMENSION")]
public void should_return_true_for_scene_names(string title)
{
SceneChecker.IsSceneTitle(title).Should().BeTrue();
}
[TestCase("S08E05 - Virtual In-Stanity [WEBDL-720p]")]
[TestCase("S08E05 - Virtual In-Stanity.With.Dots [WEBDL-720p]")]
[TestCase("Something")]
[TestCase("86de66b7ef385e2fa56a3e41b98481ea1658bfab")]
[TestCase("30.Rock.S04E17.720p.HDTV.X264", Description = "no group")]
[TestCase("S04E17.720p.HDTV.X264-DIMENSION", Description = "no series title")]
[TestCase("30.Rock.S04E17-DIMENSION", Description = "no quality")]
[TestCase("30.Rock.720p.HDTV.X264-DIMENSION", Description = "no episode")]
public void should_return_false_for_non_scene_names(string title)
{
SceneChecker.IsSceneTitle(title).Should().BeFalse();
}
}
}

@ -1,144 +0,0 @@
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.ParserTests
{
[TestFixture]
public class SingleEpisodeParserFixture : CoreTest
{
[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.113.720p.HDTV.X264-DIMENSION", "Two and a Half Me", 1, 13)]
[TestCase("Two.and.a.Half.Me.1013.720p.HDTV.X264-DIMENSION", "Two and a Half Me", 10, 13)]
[TestCase("Chuck.4x05.HDTV.XviD-LOL", "Chuck", 4, 5)]
[TestCase("The.Girls.Next.Door.S03E06.DVDRip.XviD-WiDE", "The Girls Next Door", 3, 6)]
[TestCase("Degrassi.S10E27.WS.DSR.XviD-2HD", "Degrassi", 10, 27)]
[TestCase("Parenthood.2010.S02E14.HDTV.XviD-LOL", "Parenthood 2010", 2, 14)]
[TestCase("Hawaii Five 0 S01E19 720p WEB DL DD5 1 H 264 NT", "Hawaii Five 0", 1, 19)]
[TestCase("The Event S01E14 A Message Back 720p WEB DL DD5 1 H264 SURFER", "The Event", 1, 14)]
[TestCase("Adam Hills In Gordon St Tonight S01E07 WS PDTV XviD FUtV", "Adam Hills In Gordon St Tonight", 1, 7)]
[TestCase("Adventure.Inc.S03E19.DVDRip.XviD-OSiTV", "Adventure Inc", 3, 19)]
[TestCase("S03E09 WS PDTV XviD FUtV", "", 3, 9)]
[TestCase("5x10 WS PDTV XviD FUtV", "", 5, 10)]
[TestCase("Castle.2009.S01E14.HDTV.XviD-LOL", "Castle 2009", 1, 14)]
[TestCase("Pride.and.Prejudice.1995.S03E20.HDTV.XviD-LOL", "Pride and Prejudice 1995", 3, 20)]
[TestCase("The.Office.S03E115.DVDRip.XviD-OSiTV", "The Office", 3, 115)]
[TestCase(@"Parks and Recreation - S02E21 - 94 Meetings - 720p TV.mkv", "Parks and Recreation", 2, 21)]
[TestCase(@"24-7 Penguins-Capitals- Road to the NHL Winter Classic - S01E03 - Episode 3.mkv", "24-7 Penguins-Capitals- Road to the NHL Winter Classic", 1, 3)]
[TestCase("Adventure.Inc.S03E19.DVDRip.\"XviD\"-OSiTV", "Adventure Inc", 3, 19)]
[TestCase("Hawaii Five-0 (2010) - 1x05 - Nalowale (Forgotten/Missing)", "Hawaii Five-0 (2010)", 1, 5)]
[TestCase("Hawaii Five-0 (2010) - 1x05 - Title", "Hawaii Five-0 (2010)", 1, 5)]
[TestCase("House - S06E13 - 5 to 9 [DVD]", "House", 6, 13)]
[TestCase("The Mentalist - S02E21 - 18-5-4", "The Mentalist", 2, 21)]
[TestCase("Breaking.In.S01E07.21.0.Jump.Street.720p.WEB-DL.DD5.1.h.264-KiNGS", "Breaking In", 1, 7)]
[TestCase("CSI.525", "CSI", 5, 25)]
[TestCase("King of the Hill - 10x12 - 24 Hour Propane People [SDTV]", "King of the Hill", 10, 12)]
[TestCase("Brew Masters S01E06 3 Beers For Batali DVDRip XviD SPRiNTER", "Brew Masters", 1, 6)]
[TestCase("24 7 Flyers Rangers Road to the NHL Winter Classic Part01 720p HDTV x264 ORENJI", "24 7 Flyers Rangers Road to the NHL Winter Classic", 1, 1)]
[TestCase("24 7 Flyers Rangers Road to the NHL Winter Classic Part 02 720p HDTV x264 ORENJI", "24 7 Flyers Rangers Road to the NHL Winter Classic", 1, 2)]
[TestCase("24-7 Flyers-Rangers- Road to the NHL Winter Classic - S01E01 - Part 1", "24-7 Flyers-Rangers- Road to the NHL Winter Classic", 1, 1)]
[TestCase("S6E02-Unwrapped-(Playing With Food) - [DarkData]", "", 6, 2)]
[TestCase("S06E03-Unwrapped-(Number Ones Unwrapped) - [DarkData]", "", 6, 3)]
[TestCase("The Mentalist S02E21 18 5 4 720p WEB DL DD5 1 h 264 EbP", "The Mentalist", 2, 21)]
[TestCase("01x04 - Halloween, Part 1 - 720p WEB-DL", "", 1, 4)]
[TestCase("extras.s03.e05.ws.dvdrip.xvid-m00tv", "extras", 3, 5)]
[TestCase("castle.2009.416.hdtv-lol", "castle 2009", 4, 16)]
[TestCase("hawaii.five-0.2010.217.hdtv-lol", "hawaii five-0 2010", 2, 17)]
[TestCase("Looney Tunes - S1936E18 - I Love to Singa", "Looney Tunes", 1936, 18)]
[TestCase("American_Dad!_-_7x6_-_The_Scarlett_Getter_[SDTV]", "American Dad!", 7, 6)]
[TestCase("Falling_Skies_-_1x1_-_Live_and_Learn_[HDTV-720p]", "Falling Skies", 1, 1)]
[TestCase("Top Gear - 07x03 - 2005.11.70", "Top Gear", 7, 3)]
[TestCase("Glee.S04E09.Swan.Song.1080p.WEB-DL.DD5.1.H.264-ECI", "Glee", 4, 9)]
[TestCase("S08E20 50-50 Carla [DVD]", "", 8, 20)]
[TestCase("Cheers S08E20 50-50 Carla [DVD]", "Cheers", 8, 20)]
[TestCase("S02E10 6-50 to SLC [SDTV]", "", 2, 10)]
[TestCase("Franklin & Bash S02E10 6-50 to SLC [SDTV]", "Franklin & Bash", 2, 10)]
[TestCase("The_Big_Bang_Theory_-_6x12_-_The_Egg_Salad_Equivalency_[HDTV-720p]", "The Big Bang Theory", 6, 12)]
[TestCase("Top_Gear.19x06.720p_HDTV_x264-FoV", "Top Gear", 19, 6)]
[TestCase("Portlandia.S03E10.Alexandra.720p.WEB-DL.AAC2.0.H.264-CROM.mkv", "Portlandia", 3, 10)]
[TestCase("(Game of Thrones s03 e - \"Game of Thrones Season 3 Episode 10\"", "Game of Thrones", 3, 10)]
[TestCase("House.Hunters.International.S05E607.720p.hdtv.x264", "House Hunters International", 5, 607)]
[TestCase("Adventure.Time.With.Finn.And.Jake.S01E20.720p.BluRay.x264-DEiMOS", "Adventure Time With Finn And Jake", 1, 20)]
[TestCase("Hostages.S01E04.2-45.PM.[HDTV-720p].mkv", "Hostages", 1, 4)]
[TestCase("S01E04", "", 1, 4)]
[TestCase("1x04", "", 1, 4)]
[TestCase("10.Things.You.Dont.Know.About.S02E04.Prohibition.HDTV.XviD-AFG", "10 Things You Dont Know About", 2, 4)]
[TestCase("30 Rock - S01E01 - Pilot.avi", "30 Rock", 1, 1)]
[TestCase("666 Park Avenue - S01E01", "666 Park Avenue", 1, 1)]
[TestCase("Warehouse 13 - S01E01", "Warehouse 13", 1, 1)]
[TestCase("Don't Trust The B---- in Apartment 23.S01E01", "Don't Trust The B---- in Apartment 23", 1, 1)]
[TestCase("Warehouse.13.S01E01", "Warehouse 13", 1, 1)]
[TestCase("Dont.Trust.The.B----.in.Apartment.23.S01E01", "Dont Trust The B---- in Apartment 23", 1, 1)]
[TestCase("24 S01E01", "24", 1, 1)]
[TestCase("24.S01E01", "24", 1, 1)]
[TestCase("Homeland - 2x12 - The Choice [HDTV-1080p].mkv", "Homeland", 2, 12)]
[TestCase("Homeland - 2x4 - New Car Smell [HDTV-1080p].mkv", "Homeland", 2, 4)]
[TestCase("Top Gear - 06x11 - 2005.08.07", "Top Gear", 6, 11)]
[TestCase("The_Voice_US_s06e19_04.28.2014_hdtv.x264.Poke.mp4", "The Voice US", 6, 19)]
[TestCase("the.100.110.hdtv-lol", "the 100", 1, 10)]
[TestCase("2009x09 [SDTV].avi", "", 2009, 9)]
[TestCase("S2009E09 [SDTV].avi", "", 2009, 9)]
[TestCase("Shark Week S2009E09 [SDTV].avi", "Shark Week", 2009, 9)]
[TestCase("St_Elsewhere_209_Aids_And_Comfort", "St Elsewhere", 2, 9)]
[TestCase("[Impatience] Locodol - 0x01 [720p][34073169].mkv", "Locodol", 0, 1)]
[TestCase("South.Park.S15.E06.City.Sushi", "South Park", 15, 6)]
[TestCase("South Park - S15 E06 - City Sushi", "South Park", 15, 6)]
[TestCase("Constantine S1-E1-WEB-DL-1080p-NZBgeek", "Constantine", 1, 1)]
[TestCase("Constantine S1E1-WEB-DL-1080p-NZBgeek", "Constantine", 1, 1)]
[TestCase("NCIS.S010E16.720p.HDTV.X264-DIMENSION", "NCIS", 10, 16)]
[TestCase("[ www.Torrenting.com ] - Revolution.2012.S02E17.720p.HDTV.X264-DIMENSION", "Revolution 2012", 2, 17)]
[TestCase("Revolution.2012.S02E18.720p.HDTV.X264-DIMENSION.mkv", "Revolution 2012", 2, 18)]
[TestCase("Series - Season 1 - Episode 01 (Resolution).avi", "Series", 1, 1)]
[TestCase("5x09 - 100 [720p WEB-DL].mkv", "", 5, 9)]
[TestCase("1x03 - 274 [1080p BluRay].mkv", "", 1, 3)]
[TestCase("1x03 - The 112th Congress [1080p BluRay].mkv", "", 1, 3)]
[TestCase("Revolution.2012.S02E14.720p.HDTV.X264-DIMENSION [PublicHD].mkv", "Revolution 2012", 2, 14)]
//[TestCase("Sex And The City S6E15 - Catch-38 [RavyDavy].avi", "Sex And The City", 6, 15)] // -38 is getting treated as abs number
[TestCase("Castle.2009.S06E03.720p.HDTV.X264-DIMENSION [PublicHD].mkv", "Castle 2009", 6, 3)]
[TestCase("19-2.2014.S02E01.720p.HDTV.x264-CROOKS", "19-2 2014", 2, 1)]
[TestCase("Community - S01E09 - Debate 109", "Community", 1, 9)]
[TestCase("Entourage - S02E02 - My Maserati Does 185", "Entourage", 2, 2)]
[TestCase("6x13 - The Family Guy 100th Episode Special", "", 6, 13)]
//[TestCase("Heroes - S01E01 - Genesis 101 [HDTV-720p]", "Heroes", 1, 1)]
//[TestCase("The 100 S02E01 HDTV x264-KILLERS [eztv]", "The 100", 2, 1)]
[TestCase("The Young And The Restless - S41 E10478 - 2014-08-15", "The Young And The Restless", 41, 10478)]
[TestCase("The Young And The Restless - S42 E10591 - 2015-01-27", "The Young And The Restless", 42, 10591)]
[TestCase("Series Title [1x05] Episode Title", "Series Title", 1, 5)]
[TestCase("Series Title [S01E05] Episode Title", "Series Title", 1, 5)]
[TestCase("Series Title Season 01 Episode 05 720p", "Series Title", 1, 5)]
//[TestCase("Off the Air - 101 - Animals (460p.x264.vorbis-2.0) [449].mkv", "Off the Air", 1, 1)]
[TestCase("The Young And the Restless - S42 E10713 - 2015-07-20.mp4", "The Young And the Restless", 42, 10713)]
[TestCase("quantico.103.hdtv-lol[ettv].mp4", "quantico", 1, 3)]
[TestCase("Fargo - 01x02 - The Rooster Prince - [itz_theo]", "Fargo", 1, 2)]
[TestCase("Castle (2009) - [06x16] - Room 147.mp4", "Castle (2009)", 6, 16)]
[TestCase("grp-zoos01e11-1080p", "grp-zoo", 1, 11)]
[TestCase("grp-zoo-s01e11-1080p", "grp-zoo", 1, 11)]
[TestCase("Jeopardy!.S2016E14.2016-01-20.avi", "Jeopardy!", 2016, 14)]
[TestCase("Ken.Burns.The.Civil.War.5of9.The.Universe.Of.Battle.1990.DVDRip.x264-HANDJOB", "Ken Burns The Civil War", 1, 5)]
[TestCase("Judge Judy 2016 02 25 S20E142", "Judge Judy", 20, 142)]
[TestCase("Judge Judy 2016 02 25 S20E143", "Judge Judy", 20, 143)]
[TestCase("Red Dwarf - S02 - E06 - Parallel Universe", "Red Dwarf", 2, 6)]
[TestCase("O.J.Simpson.Made.in.America.Part.Two.720p.HDTV.x264-2HD", "O J Simpson Made in America", 1, 2)]
[TestCase("The.100000.Dollar.Pyramid.2016.S01E05.720p.HDTV.x264-W4F", "The 100000 Dollar Pyramid 2016", 1, 5)]
[TestCase("Class S01E02 (22 October 2016) HDTV 720p [Webrip]", "Class", 1, 2)]
[TestCase("this.is.not.happening.2015.0308-yestv", "this is not happening 2015", 3, 8)]
[TestCase("Jeopardy - S2016E231", "Jeopardy", 2016, 231)]
[TestCase("Jeopardy - 2016x231", "Jeopardy", 2016, 231)]
[TestCase("Shortland.Street.S26E022.HDTV.x264-FiHTV", "Shortland Street", 26, 22)]
//[TestCase("", "", 0, 0)]
public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber)
{
var result = Parser.Parser.ParseAlbumTitle(postTitle);
result.Should().NotBeNull();
//result.EpisodeNumbers.Should().HaveCount(1);
//result.SeasonNumber.Should().Be(seasonNumber);
//result.EpisodeNumbers.First().Should().Be(episodeNumber);
//result.SeriesTitle.Should().Be(title);
//result.AbsoluteEpisodeNumbers.Should().BeEmpty();
//result.FullSeason.Should().BeFalse();
}
}
}

@ -21,34 +21,34 @@ namespace NzbDrone.Core.Test.UpdateTests
public void no_update_when_version_higher()
{
UseRealHttp();
Subject.GetLatestUpdate("master", new Version(10, 0)).Should().BeNull();
Subject.GetLatestUpdate("nightly", new Version(10, 0)).Should().BeNull();
}
[Test]
public void finds_update_when_version_lower()
{
UseRealHttp();
Subject.GetLatestUpdate("master", new Version(2, 0)).Should().NotBeNull();
Subject.GetLatestUpdate("nightly", new Version(0, 2)).Should().NotBeNull();
}
[Test]
public void should_get_master_if_branch_doesnt_exit()
{
UseRealHttp();
Subject.GetLatestUpdate("invalid_branch", new Version(2, 0)).Should().NotBeNull();
Subject.GetLatestUpdate("invalid_branch", new Version(0, 2)).Should().NotBeNull();
}
[Test]
public void should_get_recent_updates()
{
const string branch = "master";
const string branch = "nightly";
UseRealHttp();
var recent = Subject.GetRecentUpdates(branch, new Version(2, 0));
var recent = Subject.GetRecentUpdates(branch, new Version(0, 2));
recent.Should().NotBeEmpty();
recent.Should().OnlyContain(c => c.Hash.IsNotNullOrWhiteSpace());
recent.Should().OnlyContain(c => c.FileName.Contains("Drone.master.2"));
recent.Should().OnlyContain(c => c.FileName.Contains("Lidarr.develop.0"));
recent.Should().OnlyContain(c => c.ReleaseDate.Year >= 2014);
recent.Where(c => c.Changes != null).Should().OnlyContain(c => c.Changes.New != null);
recent.Where(c => c.Changes != null).Should().OnlyContain(c => c.Changes.Fixed != null);

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using FluentAssertions;
@ -35,9 +35,9 @@ namespace NzbDrone.Core.Test.UpdateTests
{
_updatePackage = new UpdatePackage
{
FileName = "NzbDrone.develop.2.0.0.0.tar.gz",
Url = "http://download.lidarr.audio/v2/develop/mono/NzbDrone.develop.tar.gz",
Version = new Version("2.0.0.0")
FileName = "Lidarr.develop.0.2.0.195.tar.gz",
Url = "https://ci.appveyor.com/api/buildjobs/5fk7if5wjlb8twhv/artifacts/_artifacts/Lidarr.develop.0.2.0.195.linux.tar.gz",
Version = new Version("0.2.0.195")
};
}
@ -45,9 +45,9 @@ namespace NzbDrone.Core.Test.UpdateTests
{
_updatePackage = new UpdatePackage
{
FileName = "NzbDrone.develop.2.0.0.0.zip",
Url = "http://download.lidarr.audio/v2/develop/windows/NzbDrone.develop.zip",
Version = new Version("2.0.0.0")
FileName = "Lidarr.develop.0.2.0.195.zip",
Url = "https://ci.appveyor.com/api/buildjobs/5fk7if5wjlb8twhv/artifacts/_artifacts/Lidarr.develop.0.2.0.195.windows.zip",
Version = new Version("0.2.0.195")
};
}
@ -173,7 +173,7 @@ namespace NzbDrone.Core.Test.UpdateTests
[Platform("Mono")]
public void should_run_script_if_configured()
{
const string scriptPath = "/tmp/nzbdrone/update.sh";
const string scriptPath = "/tmp/lidarr/update.sh";
GivenInstallScript(scriptPath);
@ -186,7 +186,7 @@ namespace NzbDrone.Core.Test.UpdateTests
[Platform("Mono")]
public void should_throw_if_script_is_not_set()
{
const string scriptPath = "/tmp/nzbdrone/update.sh";
const string scriptPath = "/tmp/lidarr/update.sh";
GivenInstallScript("");
@ -200,7 +200,7 @@ namespace NzbDrone.Core.Test.UpdateTests
[Platform("Mono")]
public void should_throw_if_script_is_null()
{
const string scriptPath = "/tmp/nzbdrone/update.sh";
const string scriptPath = "/tmp/lidarr/update.sh";
GivenInstallScript(null);
@ -214,7 +214,7 @@ namespace NzbDrone.Core.Test.UpdateTests
[Platform("Mono")]
public void should_throw_if_script_path_does_not_exist()
{
const string scriptPath = "/tmp/nzbdrone/update.sh";
const string scriptPath = "/tmp/lidarr/update.sh";
GivenInstallScript(scriptPath);
@ -245,7 +245,7 @@ namespace NzbDrone.Core.Test.UpdateTests
updateSubFolder.Refresh();
updateSubFolder.Exists.Should().BeTrue();
updateSubFolder.GetDirectories("NzbDrone").Should().HaveCount(1);
updateSubFolder.GetDirectories("Lidarr").Should().HaveCount(1);
updateSubFolder.GetDirectories().Should().HaveCount(1);
updateSubFolder.GetFiles().Should().NotBeEmpty();
}
@ -253,8 +253,8 @@ namespace NzbDrone.Core.Test.UpdateTests
[Test]
public void should_log_error_when_app_data_is_child_of_startup_folder()
{
Mocker.GetMock<IAppFolderInfo>().SetupGet(c => c.StartUpFolder).Returns(@"C:\NzbDrone".AsOsAgnostic);
Mocker.GetMock<IAppFolderInfo>().SetupGet(c => c.AppDataFolder).Returns(@"C:\NzbDrone\AppData".AsOsAgnostic);
Mocker.GetMock<IAppFolderInfo>().SetupGet(c => c.StartUpFolder).Returns(@"C:\Lidarr".AsOsAgnostic);
Mocker.GetMock<IAppFolderInfo>().SetupGet(c => c.AppDataFolder).Returns(@"C:\LIdarr\AppData".AsOsAgnostic);
Assert.Throws<CommandFailedException>(() => Subject.Execute(new ApplicationUpdateCommand()));
ExceptionVerification.ExpectedErrors(1);

@ -1,4 +1,4 @@
using FluentValidation;
using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
@ -28,7 +28,7 @@ namespace NzbDrone.Core.Download.Clients.Hadouken
{
Host = "localhost";
Port = 7070;
Category = "Lidarr-tv";
Category = "lidarr-music";
}
[FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)]

@ -37,6 +37,11 @@ namespace NzbDrone.Core.Download.Clients.Pneumatic
var url = remoteAlbum.Release.DownloadUrl;
var title = remoteAlbum.Release.Title;
if (remoteAlbum.ParsedAlbumInfo.Discography)
{
throw new NotSupportedException("Discography releases are not supported with Pneumatic.");
}
title = FileNameBuilder.CleanFileName(title);
//Save to the Pneumatic directory (The user will need to ensure its accessible by XBMC)

Loading…
Cancel
Save