acdream/tests/AcDream.App.Tests/Composition/SessionStartCompositionTests.cs
Erik 854d9e9cd1 feat(runtime): define borrowed views commands and ordered events
Establish the J1 presentation-independent contract with instance-scoped clocks and generations, immutable borrowed views, typed generation-gated commands, normalized ordered diagnostics, and teardown acknowledgements. Route graphical startup plus press-time selection, movement, and combat through focused App adapters over the exact existing owners without adding a queue or mirrored world.

Validated by the Release solution build, 13 Runtime tests, 3,838 App tests with three existing skips, and the complete 8,424-test Release suite with five existing skips.

Co-authored-by: Codex <codex@openai.com>
2026-07-25 19:08:42 +02:00

44 lines
1.4 KiB
C#

using AcDream.App.Composition;
using AcDream.Runtime;
namespace AcDream.App.Tests.Composition;
public sealed class SessionStartCompositionTests
{
[Fact]
public void DiagnosticsPreserveMissingCredentialAndFailureMessagesOnly()
{
var messages = new List<string>();
SessionStartCompositionPhase.Report(
new RuntimeSessionStartResult(
RuntimeSessionStartStatus.MissingCredentials,
default),
messages.Add);
SessionStartCompositionPhase.Report(
new RuntimeSessionStartResult(
RuntimeSessionStartStatus.Failed,
default,
Error: new InvalidOperationException("boom")),
messages.Add);
SessionStartCompositionPhase.Report(
new RuntimeSessionStartResult(
RuntimeSessionStartStatus.Disabled,
default),
messages.Add);
SessionStartCompositionPhase.Report(
new RuntimeSessionStartResult(
RuntimeSessionStartStatus.Connected,
default),
messages.Add);
Assert.Equal(2, messages.Count);
Assert.Equal(
"live: ACDREAM_LIVE set but TEST_USER/TEST_PASS missing; skipping",
messages[0]);
Assert.StartsWith(
"live: session failed: System.InvalidOperationException: boom",
messages[1],
StringComparison.Ordinal);
}
}