Refactor campaign payload loading

This commit is contained in:
2026-04-01 23:06:46 +02:00
parent 1c8cb71cb4
commit 8561c6643a
19 changed files with 246 additions and 152 deletions

View File

@@ -1,6 +1,3 @@
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Options;
namespace RpgRoller.Tests;
public sealed class FrontendHostTests : ApiTestBase
@@ -21,24 +18,4 @@ public sealed class FrontendHostTests : ApiTestBase
Assert.Contains("_framework/blazor.web.js", html);
Assert.Contains("Connecting...", html);
}
[Fact]
public void BlazorHub_AllowsLargerInteropPayloads()
{
using var factory = CreateFactory();
var componentHubType = Type.GetType("Microsoft.AspNetCore.Components.Server.ComponentHub, Microsoft.AspNetCore.Components.Server");
Assert.NotNull(componentHubType);
var hubOptionsType = typeof(HubOptions<>).MakeGenericType(componentHubType);
var optionsType = typeof(IOptions<>).MakeGenericType(hubOptionsType);
var options = factory.Services.GetService(optionsType);
Assert.NotNull(options);
var value = optionsType.GetProperty("Value")!.GetValue(options);
Assert.NotNull(value);
var maximumReceiveMessageSize = (long?)hubOptionsType.GetProperty("MaximumReceiveMessageSize")!.GetValue(value);
Assert.Equal(256 * 1024, maximumReceiveMessageSize);
}
}