Merge pull request #2245 from BnMcG/1874-regression-test
Add a test to prevent a regression of absolute path generation behaviourpull/2294/head
commit
c3efcbf77e
@ -0,0 +1,32 @@
|
|||||||
|
using AutoFixture;
|
||||||
|
using AutoFixture.AutoMoq;
|
||||||
|
using Emby.Server.Implementations.IO;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace Jellyfin.Server.Implementations.Tests.IO
|
||||||
|
{
|
||||||
|
public class ManagedFileSystemTests
|
||||||
|
{
|
||||||
|
private readonly IFixture _fixture;
|
||||||
|
private readonly ManagedFileSystem _sut;
|
||||||
|
|
||||||
|
public ManagedFileSystemTests()
|
||||||
|
{
|
||||||
|
_fixture = new Fixture().Customize(new AutoMoqCustomization { ConfigureMembers = true });
|
||||||
|
_sut = _fixture.Create<ManagedFileSystem>();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[InlineData("/Volumes/Library/Sample/Music/Playlists/", "../Beethoven/Misc/Moonlight Sonata.mp3", "/Volumes/Library/Sample/Music/Beethoven/Misc/Moonlight Sonata.mp3")]
|
||||||
|
[InlineData("/Volumes/Library/Sample/Music/Playlists/", "../../Beethoven/Misc/Moonlight Sonata.mp3", "/Volumes/Library/Sample/Beethoven/Misc/Moonlight Sonata.mp3")]
|
||||||
|
[InlineData("/Volumes/Library/Sample/Music/Playlists/", "Beethoven/Misc/Moonlight Sonata.mp3", "/Volumes/Library/Sample/Music/Playlists/Beethoven/Misc/Moonlight Sonata.mp3")]
|
||||||
|
public void MakeAbsolutePathCorrectlyHandlesRelativeFilePaths(
|
||||||
|
string folderPath,
|
||||||
|
string filePath,
|
||||||
|
string expectedAbsolutePath)
|
||||||
|
{
|
||||||
|
var generatedPath = _sut.MakeAbsolutePath(folderPath, filePath);
|
||||||
|
Assert.Equal(expectedAbsolutePath, generatedPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue