diff options
| author | Ben Magee <ben@bmagee.com> | 2020-01-08 22:52:33 +0000 |
|---|---|---|
| committer | Ben Magee <ben@bmagee.com> | 2020-01-08 22:52:33 +0000 |
| commit | 43c76b48c9f90afc34a5fd40aa1a28c8ae7b736a (patch) | |
| tree | 93be846edb00539134b8841418ac45594ea63a9d /tests/Emby.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs | |
| parent | 124a852787ff94201de452a952eb31376beafe12 (diff) | |
Added a test to prevent a regression of the issue seen in #1874. This issue was fixed in PR#2240
Diffstat (limited to 'tests/Emby.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs')
| -rw-r--r-- | tests/Emby.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/Emby.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs b/tests/Emby.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs new file mode 100644 index 000000000..586c50db6 --- /dev/null +++ b/tests/Emby.Server.Implementations.Tests/IO/ManagedFileSystemTests.cs @@ -0,0 +1,31 @@ +using AutoFixture; +using AutoFixture.AutoMoq; +using Emby.Server.Implementations.IO; +using Xunit; + +namespace Emby.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")] + public void MakeAbsolutePathCorrectlyHandlesRelativeFilePaths( + string folderPath, + string filePath, + string expectedAbsolutePath) + { + var generatedPath = _sut.MakeAbsolutePath(folderPath, filePath); + Assert.Equal(expectedAbsolutePath, generatedPath); + } + } +} |
