mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
fix tests
This commit is contained in:
parent
d2f7cb0442
commit
1d7d480efe
@ -51,12 +51,7 @@ namespace Jellyfin.Api.Controllers
|
|||||||
public ActionResult<string> GetBrandingCss()
|
public ActionResult<string> GetBrandingCss()
|
||||||
{
|
{
|
||||||
var options = _serverConfigurationManager.GetConfiguration<BrandingOptions>("branding");
|
var options = _serverConfigurationManager.GetConfiguration<BrandingOptions>("branding");
|
||||||
if (string.IsNullOrEmpty(options.CustomCss))
|
return options.CustomCss ?? string.Empty;
|
||||||
{
|
|
||||||
return NoContent();
|
|
||||||
}
|
|
||||||
|
|
||||||
return options.CustomCss;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
26
MediaBrowser.Api/TestService.cs
Normal file
26
MediaBrowser.Api/TestService.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
using MediaBrowser.Controller.Configuration;
|
||||||
|
using MediaBrowser.Controller.Net;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
namespace MediaBrowser.Api
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service for testing path value.
|
||||||
|
/// </summary>
|
||||||
|
public class TestService : BaseApiService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Test service.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="logger">Instance of the <see cref="ILogger{TestService}"/> interface.</param>
|
||||||
|
/// <param name="serverConfigurationManager">Instance of the <see cref="IServerConfigurationManager"/> interface.</param>
|
||||||
|
/// <param name="httpResultFactory">Instance of the <see cref="IHttpResultFactory"/> interface.</param>
|
||||||
|
public TestService(
|
||||||
|
ILogger<TestService> logger,
|
||||||
|
IServerConfigurationManager serverConfigurationManager,
|
||||||
|
IHttpResultFactory httpResultFactory)
|
||||||
|
: base(logger, serverConfigurationManager, httpResultFactory)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -31,8 +31,8 @@ namespace Jellyfin.Api.Tests
|
|||||||
|
|
||||||
var confManagerMock = Mock.Of<IServerConfigurationManager>(x => x.Configuration == conf);
|
var confManagerMock = Mock.Of<IServerConfigurationManager>(x => x.Configuration == conf);
|
||||||
|
|
||||||
var service = new BrandingService(
|
var service = new TestService(
|
||||||
new NullLogger<BrandingService>(),
|
new NullLogger<TestService>(),
|
||||||
confManagerMock,
|
confManagerMock,
|
||||||
Mock.Of<IHttpResultFactory>())
|
Mock.Of<IHttpResultFactory>())
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,7 @@ namespace MediaBrowser.Api.Tests
|
|||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
response.EnsureSuccessStatusCode();
|
response.EnsureSuccessStatusCode();
|
||||||
Assert.Equal("text/css", response.Content.Headers.ContentType.ToString());
|
Assert.Equal("text/css; charset=utf-8", response.Content.Headers.ContentType.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user