Files
pgsql-jellyfin/tests/Jellyfin.Server.Implementations.Tests/Library/MediaSourceManagerTests.cs
T
wjones af1152b001 Refactor: standardize namespace and using directive style
Refactored all C# test files to use explicit namespace declarations and moved all using directives inside the namespace block for consistency. Updated assembly info and cache files to reflect the new build. Adjusted MvcTestingAppManifest.json to use fully qualified assembly names. No functional changes; all updates are related to code style, organization, and project metadata.
2026-02-20 16:26:53 -05:00

37 lines
1.5 KiB
C#

// <copyright file="MediaSourceManagerTests.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Server.Implementations.Tests.Library
{
using AutoFixture;
using AutoFixture.AutoMoq;
using Emby.Server.Implementations.IO;
using Emby.Server.Implementations.Library;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.MediaInfo;
using Xunit;
public class MediaSourceManagerTests
{
private readonly MediaSourceManager _mediaSourceManager;
public MediaSourceManagerTests()
{
IFixture fixture = new Fixture().Customize(new AutoMoqCustomization { ConfigureMembers = true });
fixture.Inject<IFileSystem>(fixture.Create<ManagedFileSystem>());
_mediaSourceManager = fixture.Create<MediaSourceManager>();
}
[Theory]
[InlineData(@"C:\mydir\myfile.ext", MediaProtocol.File)]
[InlineData("/mydir/myfile.ext", MediaProtocol.File)]
[InlineData("file:///mydir/myfile.ext", MediaProtocol.File)]
[InlineData("http://example.com/stream.m3u8", MediaProtocol.Http)]
[InlineData("https://example.com/stream.m3u8", MediaProtocol.Http)]
[InlineData("rtsp://media.example.com:554/twister/audiotrack", MediaProtocol.Rtsp)]
public void GetPathProtocol_ValidArg_Correct(string path, MediaProtocol expected)
=> Assert.Equal(expected, _mediaSourceManager.GetPathProtocol(path));
}
}