using NUnit.Framework; using SVSim.EmulatedEntrypoint.Services; namespace SVSim.UnitTests.Services; public class ShadowverseSessionServiceTests { /// /// Fixture captured live from a fresh signup against this server. The client computed this /// exact SID locally and sent it on the next /check/game_start request. Pinning the formula /// here means any future refactor of /// that drifts from Cute/Cryptographer.MakeMd5(viewerId + udid) will fail this test /// before the user discovers it as a decrypt failure on game_start. /// [Test] public void ComputeClientSessionId_matches_captured_fixture() { var svc = new ShadowverseSessionService(); const long viewerId = 1; var udid = new System.Guid("62747917-93bc-454c-abb4-ef423b3c9317"); string sid = svc.ComputeClientSessionId(viewerId, udid); Assert.That(sid, Is.EqualTo("dc4aac79d35fe15dfb6262e0071bb03c")); } [Test] public void StoreSessionForViewer_makes_sid_resolvable_to_udid() { var svc = new ShadowverseSessionService(); const long viewerId = 1; var udid = new System.Guid("62747917-93bc-454c-abb4-ef423b3c9317"); svc.StoreSessionForViewer(viewerId, udid); Assert.That(svc.GetUdidFromSessionId("dc4aac79d35fe15dfb6262e0071bb03c"), Is.EqualTo(udid)); } }