mirror of
https://github.com/Sonarr/Sonarr
synced 2025-02-26 07:53:36 +00:00
HashedReleaseFixture uses OS agnostic paths
This commit is contained in:
parent
9b880f7e59
commit
14554b49bc
3 changed files with 39 additions and 21 deletions
|
@ -191,7 +191,7 @@
|
||||||
<Compile Include="ParserTests\NormalizeTitleFixture.cs" />
|
<Compile Include="ParserTests\NormalizeTitleFixture.cs" />
|
||||||
<Compile Include="ParserTests\CrapParserFixture.cs" />
|
<Compile Include="ParserTests\CrapParserFixture.cs" />
|
||||||
<Compile Include="ParserTests\DailyEpisodeParserFixture.cs" />
|
<Compile Include="ParserTests\DailyEpisodeParserFixture.cs" />
|
||||||
<Compile Include="ParserTests\HashedReleasesFixture.cs" />
|
<Compile Include="ParserTests\HashedReleaseFixture.cs" />
|
||||||
<Compile Include="ParserTests\SingleEpisodeParserFixture.cs" />
|
<Compile Include="ParserTests\SingleEpisodeParserFixture.cs" />
|
||||||
<Compile Include="ParserTests\PathParserFixture.cs" />
|
<Compile Include="ParserTests\PathParserFixture.cs" />
|
||||||
<Compile Include="ParserTests\MultiEpisodeParserFixture.cs" />
|
<Compile Include="ParserTests\MultiEpisodeParserFixture.cs" />
|
||||||
|
|
38
src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs
Normal file
38
src/NzbDrone.Core.Test/ParserTests/HashedReleaseFixture.cs
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
using FluentAssertions;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using NzbDrone.Core.Test.Framework;
|
||||||
|
using NzbDrone.Test.Common;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Test.ParserTests
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class HashedReleaseFixture : CoreTest
|
||||||
|
{
|
||||||
|
public static object[] HashedReleaseParserCases =
|
||||||
|
{
|
||||||
|
new object[]
|
||||||
|
{
|
||||||
|
@"C:\Test\Some.Hashed.Release.S01E01.720p.WEB-DL.AAC2.0.H.264-Mercury\0e895c3724.mkv".AsOsAgnostic(),
|
||||||
|
"somehashedrelease",
|
||||||
|
"WEBDL-720p",
|
||||||
|
"Mercury"
|
||||||
|
},
|
||||||
|
new object[]
|
||||||
|
{
|
||||||
|
@"C:\Test\0e895c3724\Some.Hashed.Release.S01E01.720p.WEB-DL.AAC2.0.H.264-Mercury.mkv".AsOsAgnostic(),
|
||||||
|
"somehashedrelease",
|
||||||
|
"WEBDL-720p",
|
||||||
|
"Mercury"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
[Test, TestCaseSource("HashedReleaseParserCases")]
|
||||||
|
public void should_properly_parse_hashed_releases(string path, string title, string quality, string releaseGroup)
|
||||||
|
{
|
||||||
|
var result = Parser.Parser.ParsePath(path);
|
||||||
|
result.SeriesTitle.Should().Be(title);
|
||||||
|
result.Quality.ToString().Should().Be(quality);
|
||||||
|
result.ReleaseGroup.Should().Be(releaseGroup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,20 +0,0 @@
|
||||||
using FluentAssertions;
|
|
||||||
using NUnit.Framework;
|
|
||||||
using NzbDrone.Core.Test.Framework;
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.Test.ParserTests
|
|
||||||
{
|
|
||||||
[TestFixture]
|
|
||||||
public class hashedReleasesFixture : CoreTest
|
|
||||||
{
|
|
||||||
[TestCase(@"C:\Test\Some.Hashed.Release.S01E01.720p.WEB-DL.AAC2.0.H.264-Mercury\0e895c3724.mkv", "somehashedrelease", "WEBDL-720p", "Mercury")]
|
|
||||||
[TestCase(@"C:\Test\0e895c3724\Some.Hashed.Release.S01E01.720p.WEB-DL.AAC2.0.H.264-Mercury.mkv", "somehashedrelease", "WEBDL-720p", "Mercury")]
|
|
||||||
public void should_properly_parse_hashed_releases(string path, string title, string quality, string releaseGroup)
|
|
||||||
{
|
|
||||||
var result = Parser.Parser.ParsePath(path);
|
|
||||||
result.SeriesTitle.Should().Be(title);
|
|
||||||
result.Quality.ToString().Should().Be(quality);
|
|
||||||
result.ReleaseGroup.Should().Be(releaseGroup);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue