mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Fix tests
This commit is contained in:
parent
da17fc3e6d
commit
4b7f59e2e9
@ -68,8 +68,7 @@ namespace Kyoo.Core.Controllers
|
|||||||
string libraryPath = (await _libraryManager.GetAll<Library>())
|
string libraryPath = (await _libraryManager.GetAll<Library>())
|
||||||
.SelectMany(x => x.Paths)
|
.SelectMany(x => x.Paths)
|
||||||
.Where(path.StartsWith)
|
.Where(path.StartsWith)
|
||||||
.OrderByDescending(x => x.Length)
|
.MaxBy(x => x.Length);
|
||||||
.FirstOrDefault();
|
|
||||||
return path[(libraryPath?.Length ?? 0)..];
|
return path[(libraryPath?.Length ?? 0)..];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ namespace Kyoo.Tests.Identifier
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async Task EpisodeIdentification()
|
public async Task EpisodeIdentification()
|
||||||
{
|
{
|
||||||
_manager.Setup(x => x.GetAll(null, new Sort<Library>(), default)).ReturnsAsync(new[]
|
_manager.Setup(x => x.GetAll<Library>(null, default, default)).ReturnsAsync(new[]
|
||||||
{
|
{
|
||||||
new Library {Paths = new [] {"/kyoo/Library/"}}
|
new Library {Paths = new [] {"/kyoo/Library/"}}
|
||||||
});
|
});
|
||||||
@ -77,7 +77,7 @@ namespace Kyoo.Tests.Identifier
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async Task EpisodeIdentificationWithoutLibraryTrailingSlash()
|
public async Task EpisodeIdentificationWithoutLibraryTrailingSlash()
|
||||||
{
|
{
|
||||||
_manager.Setup(x => x.GetAll(null, new Sort<Library>(), default)).ReturnsAsync(new[]
|
_manager.Setup(x => x.GetAll<Library>(null, default, default)).ReturnsAsync(new[]
|
||||||
{
|
{
|
||||||
new Library {Paths = new [] {"/kyoo/Library"}}
|
new Library {Paths = new [] {"/kyoo/Library"}}
|
||||||
});
|
});
|
||||||
@ -97,7 +97,7 @@ namespace Kyoo.Tests.Identifier
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async Task EpisodeIdentificationMultiplePaths()
|
public async Task EpisodeIdentificationMultiplePaths()
|
||||||
{
|
{
|
||||||
_manager.Setup(x => x.GetAll(null, new Sort<Library>(), default)).ReturnsAsync(new[]
|
_manager.Setup(x => x.GetAll<Library>(null, default, default)).ReturnsAsync(new[]
|
||||||
{
|
{
|
||||||
new Library {Paths = new [] {"/kyoo", "/kyoo/Library/"}}
|
new Library {Paths = new [] {"/kyoo", "/kyoo/Library/"}}
|
||||||
});
|
});
|
||||||
@ -117,7 +117,7 @@ namespace Kyoo.Tests.Identifier
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async Task AbsoluteEpisodeIdentification()
|
public async Task AbsoluteEpisodeIdentification()
|
||||||
{
|
{
|
||||||
_manager.Setup(x => x.GetAll(null, new Sort<Library>(), default)).ReturnsAsync(new[]
|
_manager.Setup(x => x.GetAll<Library>(null, default, default)).ReturnsAsync(new[]
|
||||||
{
|
{
|
||||||
new Library {Paths = new [] {"/kyoo", "/kyoo/Library/"}}
|
new Library {Paths = new [] {"/kyoo", "/kyoo/Library/"}}
|
||||||
});
|
});
|
||||||
@ -137,7 +137,7 @@ namespace Kyoo.Tests.Identifier
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async Task MovieEpisodeIdentification()
|
public async Task MovieEpisodeIdentification()
|
||||||
{
|
{
|
||||||
_manager.Setup(x => x.GetAll(null, new Sort<Library>(), default)).ReturnsAsync(new[]
|
_manager.Setup(x => x.GetAll<Library>(null, default, default)).ReturnsAsync(new[]
|
||||||
{
|
{
|
||||||
new Library {Paths = new [] {"/kyoo", "/kyoo/Library/"}}
|
new Library {Paths = new [] {"/kyoo", "/kyoo/Library/"}}
|
||||||
});
|
});
|
||||||
@ -158,7 +158,7 @@ namespace Kyoo.Tests.Identifier
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async Task InvalidEpisodeIdentification()
|
public async Task InvalidEpisodeIdentification()
|
||||||
{
|
{
|
||||||
_manager.Setup(x => x.GetAll(null, new Sort<Library>(), default)).ReturnsAsync(new[]
|
_manager.Setup(x => x.GetAll<Library>(null, default, default)).ReturnsAsync(new[]
|
||||||
{
|
{
|
||||||
new Library {Paths = new [] {"/kyoo", "/kyoo/Library/"}}
|
new Library {Paths = new [] {"/kyoo", "/kyoo/Library/"}}
|
||||||
});
|
});
|
||||||
@ -168,7 +168,7 @@ namespace Kyoo.Tests.Identifier
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async Task SubtitleIdentification()
|
public async Task SubtitleIdentification()
|
||||||
{
|
{
|
||||||
_manager.Setup(x => x.GetAll(null, new Sort<Library>(), default)).ReturnsAsync(new[]
|
_manager.Setup(x => x.GetAll<Library>(null, default, default)).ReturnsAsync(new[]
|
||||||
{
|
{
|
||||||
new Library {Paths = new [] {"/kyoo", "/kyoo/Library/"}}
|
new Library {Paths = new [] {"/kyoo", "/kyoo/Library/"}}
|
||||||
});
|
});
|
||||||
@ -184,7 +184,7 @@ namespace Kyoo.Tests.Identifier
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async Task SubtitleIdentificationUnknownCodec()
|
public async Task SubtitleIdentificationUnknownCodec()
|
||||||
{
|
{
|
||||||
_manager.Setup(x => x.GetAll(null, new Sort<Library>(), default)).ReturnsAsync(new[]
|
_manager.Setup(x => x.GetAll<Library>(null, default, default)).ReturnsAsync(new[]
|
||||||
{
|
{
|
||||||
new Library {Paths = new [] {"/kyoo", "/kyoo/Library/"}}
|
new Library {Paths = new [] {"/kyoo", "/kyoo/Library/"}}
|
||||||
});
|
});
|
||||||
@ -200,7 +200,7 @@ namespace Kyoo.Tests.Identifier
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async Task InvalidSubtitleIdentification()
|
public async Task InvalidSubtitleIdentification()
|
||||||
{
|
{
|
||||||
_manager.Setup(x => x.GetAll(null, new Sort<Library>(), default)).ReturnsAsync(new[]
|
_manager.Setup(x => x.GetAll<Library>(null, default, default)).ReturnsAsync(new[]
|
||||||
{
|
{
|
||||||
new Library {Paths = new [] {"/kyoo", "/kyoo/Library/"}}
|
new Library {Paths = new [] {"/kyoo", "/kyoo/Library/"}}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user