check operating system for absolute path test

This commit is contained in:
dkanada
2020-01-13 15:34:50 +09:00
parent a8cd963d46
commit 65e9a705d3
3 changed files with 15 additions and 4 deletions

View File

@@ -1,6 +1,8 @@
using System;
using AutoFixture;
using AutoFixture.AutoMoq;
using Emby.Server.Implementations.IO;
using MediaBrowser.Model.System;
using Xunit;
namespace Jellyfin.Server.Implementations.Tests.IO
@@ -26,7 +28,16 @@ namespace Jellyfin.Server.Implementations.Tests.IO
string expectedAbsolutePath)
{
var generatedPath = _sut.MakeAbsolutePath(folderPath, filePath);
Assert.Equal(expectedAbsolutePath, generatedPath);
if (MediaBrowser.Common.System.OperatingSystem.Id == OperatingSystemId.Windows)
{
var windowsPath = "d:" + generatedPath.Replace('/', '\\');
Assert.Equal(expectedAbsolutePath, windowsPath);
}
else
{
Assert.Equal(expectedAbsolutePath, generatedPath);
}
}
}
}