diff options
| author | crobibero <cody@robibe.ro> | 2020-06-22 08:14:07 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-06-22 08:14:07 -0600 |
| commit | 1d7d480efe52589557bdc6371731fad6d15ee1f6 (patch) | |
| tree | 21bba0ba718371def5d19015eafc9031bb18099f | |
| parent | d2f7cb0442cf12db2a00909970303bd7f5dc43e6 (diff) | |
fix tests
| -rw-r--r-- | Jellyfin.Api/Controllers/BrandingController.cs | 7 | ||||
| -rw-r--r-- | MediaBrowser.Api/TestService.cs | 26 | ||||
| -rw-r--r-- | tests/Jellyfin.Api.Tests/GetPathValueTests.cs | 4 | ||||
| -rw-r--r-- | tests/MediaBrowser.Api.Tests/BrandingServiceTests.cs | 2 |
4 files changed, 30 insertions, 9 deletions
diff --git a/Jellyfin.Api/Controllers/BrandingController.cs b/Jellyfin.Api/Controllers/BrandingController.cs index d580fedff..67790c0e4 100644 --- a/Jellyfin.Api/Controllers/BrandingController.cs +++ b/Jellyfin.Api/Controllers/BrandingController.cs @@ -51,12 +51,7 @@ namespace Jellyfin.Api.Controllers public ActionResult<string> GetBrandingCss() { var options = _serverConfigurationManager.GetConfiguration<BrandingOptions>("branding"); - if (string.IsNullOrEmpty(options.CustomCss)) - { - return NoContent(); - } - - return options.CustomCss; + return options.CustomCss ?? string.Empty; } } } diff --git a/MediaBrowser.Api/TestService.cs b/MediaBrowser.Api/TestService.cs new file mode 100644 index 000000000..6c999e08d --- /dev/null +++ b/MediaBrowser.Api/TestService.cs @@ -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) + { + } + } +} diff --git a/tests/Jellyfin.Api.Tests/GetPathValueTests.cs b/tests/Jellyfin.Api.Tests/GetPathValueTests.cs index b01d1af1f..397eb2edc 100644 --- a/tests/Jellyfin.Api.Tests/GetPathValueTests.cs +++ b/tests/Jellyfin.Api.Tests/GetPathValueTests.cs @@ -31,8 +31,8 @@ namespace Jellyfin.Api.Tests var confManagerMock = Mock.Of<IServerConfigurationManager>(x => x.Configuration == conf); - var service = new BrandingService( - new NullLogger<BrandingService>(), + var service = new TestService( + new NullLogger<TestService>(), confManagerMock, Mock.Of<IHttpResultFactory>()) { diff --git a/tests/MediaBrowser.Api.Tests/BrandingServiceTests.cs b/tests/MediaBrowser.Api.Tests/BrandingServiceTests.cs index 34698fe25..5d7f7765c 100644 --- a/tests/MediaBrowser.Api.Tests/BrandingServiceTests.cs +++ b/tests/MediaBrowser.Api.Tests/BrandingServiceTests.cs @@ -43,7 +43,7 @@ namespace MediaBrowser.Api.Tests // Assert response.EnsureSuccessStatusCode(); - Assert.Equal("text/css", response.Content.Headers.ContentType.ToString()); + Assert.Equal("text/css; charset=utf-8", response.Content.Headers.ContentType.ToString()); } } } |
