Files
LlamaCasty/ytLive.Tests/SessionStartDecisionTests.cs
T
gramps 4bc41c488c feat(topbar): the action follows the armed output; Test is an explicit ask again
Unit C (creator ruling 2026-11-12).

- Local MP4: one button, "Start Recording".
- YouTube: "Private Test Stream" beside "Review & Go Live", the latter with the primary face because it
  is the default ask.
- Running: "End Live Stream" (or "End Test" for a test run, "Stop Recording" for a local one).

The behavioural change underneath: SessionStartDecision.For no longer takes `editing`. Since 2026-10-30
EDIT silently chose test-vs-real, which meant the same button did two different things depending on a
toggle three inches away. With Test as its own button that inference has no job, so For() now reads only
the armed output and ON-AIR always means the real livestream. That supersedes the 2026-10-30 ruling;
SessionStartDecisionTests is rewritten to pin the new matrix rather than the old one.

A signed-out press still starts the sign-in flow instead of sitting dead (no-dead-ends), unchanged from
before — now stated in one place, the two new commands, instead of inside a route table.

680 pass, 0 warnings. Scope justification: Assets/starting-background.jpg is outside this unit — the
creator's replacement art, still awaiting their visual check.
2026-11-12 15:44:15 -08:00

36 lines
2.0 KiB
C#

using Xunit;
using ytLive.Models;
namespace ytLive.Tests;
/// <summary>Which session an armed output starts, and where a press routes.
///
/// <para>Superseded 2026-11-12: the ON-AIR start no longer infers Test from EDIT. The output stage
/// offers "Private Test Stream" and "Review & Go Live" as separate buttons, so ON-AIR always means the
/// real livestream here. REC always records, because there is no test recording.</para></summary>
public class SessionStartDecisionTests
{
[Fact]
public void The_armed_output_decides_the_session_kind_and_test_is_never_inferred()
{
// ON-AIR armed: the real livestream, never a test.
Assert.Equal(SessionStartKind.Live, SessionStartDecision.For(recordArmed: false, onAirArmed: true));
Assert.Equal("Go Live", SessionStartDecision.LabelFor(SessionStartKind.Live));
// REC armed: always a recording (no test recording exists).
Assert.Equal(SessionStartKind.Record, SessionStartDecision.For(true, false));
Assert.Equal("Start Recording", SessionStartDecision.LabelFor(SessionStartKind.Record));
// Signed out: an ON-AIR press (live OR test) routes to the sign-in flow, never a dead
// button. Recording never needs an account.
Assert.Equal(SessionStartDecision.Route.SignIn, SessionStartDecision.RouteFor(SessionStartKind.Live, connected: false));
Assert.Equal(SessionStartDecision.Route.SignIn, SessionStartDecision.RouteFor(SessionStartKind.Test, connected: false));
Assert.Equal(SessionStartDecision.Route.Live, SessionStartDecision.RouteFor(SessionStartKind.Live, connected: true));
Assert.Equal(SessionStartDecision.Route.Test, SessionStartDecision.RouteFor(SessionStartKind.Test, connected: true));
Assert.Equal(SessionStartDecision.Route.Record, SessionStartDecision.RouteFor(SessionStartKind.Record, connected: false));
// Unarmed start records locally (the no-dead-ends rule).
Assert.Equal(SessionStartKind.Record, SessionStartDecision.For(false, false));
}
}