Files
SVSimServer/SVSim.UnitTests/Services/DevAlwaysValidSteamServerTests.cs
gamer147 c27bf444a5 refactor(auth): drop null-guard on dev steam ticket log; add test fixture doc
ISteamServer contract forbids null tickets (prod impl and sole caller both assume non-null),
so the dev bypass no longer needs the ?. / ?? 0 defensive form. Also adds a class-level XML
doc summary to DevAlwaysValidSteamServerTests matching the style of other fixtures in the suite.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03 09:06:26 -04:00

27 lines
967 B
C#

using Microsoft.Extensions.Logging.Abstractions;
using NUnit.Framework;
using SVSim.EmulatedEntrypoint.Services;
namespace SVSim.UnitTests.Services;
/// <summary>Covers the always-accept contract and no-throw stubs of the Dev-only ISteamServer bypass.</summary>
[TestFixture]
public class DevAlwaysValidSteamServerTests
{
[Test]
public void BeginAuthSession_accepts_any_ticket_for_any_steamId()
{
var sut = new DevAlwaysValidSteamServer(NullLogger<DevAlwaysValidSteamServer>.Instance);
Assert.That(sut.BeginAuthSession(new byte[] { 0xDE, 0xAD }, 900001UL), Is.True);
Assert.That(sut.BeginAuthSession(System.Array.Empty<byte>(), 0UL), Is.True);
}
[Test]
public void Lifecycle_methods_do_not_throw()
{
var sut = new DevAlwaysValidSteamServer(NullLogger<DevAlwaysValidSteamServer>.Instance);
Assert.DoesNotThrow(() => { sut.Initialize(453480); sut.EndSession(900001UL); sut.Shutdown(); });
}
}