Browse Source

fix file system test on windows (#2657) [no ci]

pull/2658/head
Jason Dove 1 month ago committed by GitHub
parent
commit
7bc1dd63fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      ErsatzTV.Scanner.Tests/Core/Metadata/LocalSubtitlesProviderTests.cs

10
ErsatzTV.Scanner.Tests/Core/Metadata/LocalSubtitlesProviderTests.cs

@ -28,6 +28,8 @@ public class LocalSubtitlesProviderTests
// Avatar (2009).de.srt // Avatar (2009).de.srt
// Avatar (2009).de.sdh.forced.srt // Avatar (2009).de.sdh.forced.srt
private readonly string _prefix = OperatingSystem.IsWindows() ? "C:\\" : "/";
[Test] [Test]
public void Should_Find_All_Languages_Codecs_And_Flags_With_Full_Paths() public void Should_Find_All_Languages_Codecs_And_Flags_With_Full_Paths()
{ {
@ -75,7 +77,9 @@ public class LocalSubtitlesProviderTests
result.Count(s => s.SDH).ShouldBe(2); result.Count(s => s.SDH).ShouldBe(2);
result.Count(s => s.Codec == "subrip").ShouldBe(4); result.Count(s => s.Codec == "subrip").ShouldBe(4);
result.Count(s => s.Codec == "ass").ShouldBe(1); result.Count(s => s.Codec == "ass").ShouldBe(1);
result.All(s => s.Path.Contains(@"/Movies/Avatar (2009)/")).ShouldBeTrue();
string path = Path.Combine(_prefix, "Movies", "Avatar (2009)");
result.All(s => s.Path.Contains(path)).ShouldBeTrue();
} }
[Test] [Test]
@ -127,6 +131,8 @@ public class LocalSubtitlesProviderTests
result.Count(s => s.SDH).ShouldBe(3); result.Count(s => s.SDH).ShouldBe(3);
result.Count(s => s.Codec == "subrip").ShouldBe(5); result.Count(s => s.Codec == "subrip").ShouldBe(5);
result.Count(s => s.Codec == "ass").ShouldBe(2); result.Count(s => s.Codec == "ass").ShouldBe(2);
result.Count(s => s.Path.Contains(@"/Movies/Avatar (2009)/")).ShouldBe(0);
string path = Path.Combine(_prefix, "Movies", "Avatar (2009)");
result.Count(s => s.Path.Contains(path)).ShouldBe(0);
} }
} }

Loading…
Cancel
Save