build: bootstrap solution and quality gates (#3)
quality-gate / quality (push) Successful in 58s

Closes #3
This commit is contained in:
KyuubiYoru
2026-07-16 04:25:54 +02:00
parent 286fbfeb36
commit e626b89909
28 changed files with 803 additions and 0 deletions
@@ -0,0 +1,34 @@
using System.Net;
using FinalFactory.Rendezvous.Server.Transport;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
namespace FinalFactory.Rendezvous.Tests.Server;
public sealed class UdpMediatorServiceTests
{
[Fact]
public async Task ServiceBindsAnEphemeralUdpPortAndStopsCleanly()
{
using CancellationTokenSource timeout = new(TimeSpan.FromSeconds(5));
UdpMediatorOptions options = new()
{
ListenAddress = IPAddress.Loopback.ToString(),
Port = 0,
};
using UdpMediatorService service = new(
Options.Create(options),
NullLogger<UdpMediatorService>.Instance);
await service.StartAsync(timeout.Token);
IPEndPoint? boundEndpoint = service.LocalEndpoint;
Assert.NotNull(boundEndpoint);
Assert.Equal(IPAddress.Loopback, boundEndpoint.Address);
Assert.InRange(boundEndpoint.Port, 1, 65_535);
await service.StopAsync(timeout.Token);
Assert.Null(service.LocalEndpoint);
}
}