af1152b001
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.
59 lines
1.9 KiB
C#
59 lines
1.9 KiB
C#
// <copyright file="BrandingControllerTests.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace Jellyfin.Server.Integration.Tests
|
|
{
|
|
using System.Net;
|
|
using System.Net.Http.Json;
|
|
using System.Net.Mime;
|
|
using System.Text;
|
|
using System.Text.Json;
|
|
using System.Threading.Tasks;
|
|
using MediaBrowser.Model.Branding;
|
|
using Xunit;
|
|
|
|
public sealed class BrandingControllerTests : IClassFixture<JellyfinApplicationFactory>
|
|
{
|
|
private readonly JellyfinApplicationFactory _factory;
|
|
|
|
public BrandingControllerTests(JellyfinApplicationFactory factory)
|
|
{
|
|
_factory = factory;
|
|
}
|
|
|
|
[Fact]
|
|
public async Task GetConfiguration_ReturnsCorrectResponse()
|
|
{
|
|
// Arrange
|
|
var client = _factory.CreateClient();
|
|
|
|
// Act
|
|
var response = await client.GetAsync("/Branding/Configuration");
|
|
|
|
// Assert
|
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
|
Assert.Equal(MediaTypeNames.Application.Json, response.Content.Headers.ContentType?.MediaType);
|
|
Assert.Equal(Encoding.UTF8.BodyName, response.Content.Headers.ContentType?.CharSet);
|
|
await response.Content.ReadFromJsonAsync<BrandingOptions>();
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("/Branding/Css")]
|
|
[InlineData("/Branding/Css.css")]
|
|
public async Task GetCss_ReturnsCorrectResponse(string url)
|
|
{
|
|
// Arrange
|
|
var client = _factory.CreateClient();
|
|
|
|
// Act
|
|
var response = await client.GetAsync(url);
|
|
|
|
// Assert
|
|
Assert.True(response.IsSuccessStatusCode);
|
|
Assert.Equal("text/css", response.Content.Headers.ContentType?.MediaType);
|
|
Assert.Equal(Encoding.UTF8.BodyName, response.Content.Headers.ContentType?.CharSet);
|
|
}
|
|
}
|
|
}
|