2022-01-16 15:00:30 -07:00
|
|
|
using Emby.Naming.Common;
|
|
|
|
using Emby.Server.Implementations.Library.Resolvers.Movies;
|
|
|
|
using MediaBrowser.Controller;
|
|
|
|
using MediaBrowser.Controller.Drawing;
|
|
|
|
using MediaBrowser.Controller.Library;
|
|
|
|
using MediaBrowser.Controller.Providers;
|
|
|
|
using MediaBrowser.Model.IO;
|
2022-01-04 14:52:52 -07:00
|
|
|
using Microsoft.Extensions.Logging;
|
2022-01-16 15:00:30 -07:00
|
|
|
using Moq;
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
namespace Jellyfin.Server.Implementations.Tests.Library;
|
|
|
|
|
|
|
|
public class MovieResolverTests
|
|
|
|
{
|
|
|
|
private static readonly NamingOptions _namingOptions = new();
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public void Resolve_GivenLocalAlternateVersion_ResolvesToVideo()
|
|
|
|
{
|
2022-01-04 14:52:52 -07:00
|
|
|
var movieResolver = new MovieResolver(Mock.Of<IImageProcessor>(), Mock.Of<ILogger<MovieResolver>>(), _namingOptions);
|
2022-01-16 15:00:30 -07:00
|
|
|
var itemResolveArgs = new ItemResolveArgs(
|
|
|
|
Mock.Of<IServerApplicationPaths>(),
|
|
|
|
Mock.Of<IDirectoryService>())
|
|
|
|
{
|
|
|
|
Parent = null,
|
|
|
|
FileInfo = new FileSystemMetadata
|
|
|
|
{
|
|
|
|
FullName = "/movies/Black Panther (2018)/Black Panther (2018) - 1080p 3D.mk3d"
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
Assert.NotNull(movieResolver.Resolve(itemResolveArgs));
|
|
|
|
}
|
|
|
|
}
|