Adds SourceType.Scoreboard with the same per-scene eye toggle, drag and presence as every other element — 'prominent on BRB, dialled back on Live' is geometry, not a second mechanism. Default geometry is the strip: 1920 wide, 56 tall, bottom edge. The output resolver returns the presenter's cached frame exactly like the chat box and alert box do, and every session start clears the tallies. Preview publication writes one shared WriteableBitmap on the UI thread (the pump thread must never touch one), refreshed only when a displayed value moves. Guard: ScoreboardLayerTests pins the enum member, the geometry constants, the resolver case and the session hook, so the layer cannot quietly become a special widget.
33 lines
1.4 KiB
C#
33 lines
1.4 KiB
C#
using System.Linq;
|
|
using Xunit;
|
|
using ytLive.Models;
|
|
using ytLive.ViewModels;
|
|
|
|
namespace ytLive.Tests;
|
|
|
|
/// <summary>The scoreboard is a LAYER, not a special widget: it must appear as a source type, carry
|
|
/// the full-width strip geometry, be resolvable on the output path like a chat box, and hook the
|
|
/// session lifecycle so its numbers are session-scoped.</summary>
|
|
public class ScoreboardLayerTests
|
|
{
|
|
[Fact]
|
|
public void The_scoreboard_is_a_real_source_with_strip_geometry_and_a_resolver()
|
|
{
|
|
Assert.Contains("Scoreboard", System.Enum.GetNames<SourceType>());
|
|
|
|
// Geometry: full width, a strip's height, bottom by default.
|
|
var sources = SourceAssert.Text("ViewModels", "MainViewModel.Sources.cs");
|
|
Assert.Contains("SourceType.Scoreboard ? 1920", sources);
|
|
Assert.Contains("SourceType.Scoreboard ? 56", sources);
|
|
Assert.Contains("SourceType.Scoreboard ? 1024", sources);
|
|
|
|
// The output resolver knows how to produce its frame (same shape as the chat box/alert box).
|
|
var resolver = SourceAssert.Text("ViewModels", "MainViewModel.cs");
|
|
Assert.Contains("Source { Type: SourceType.Scoreboard } => _scoreboardPresenter.Frame", resolver);
|
|
|
|
// Session lifecycle: every start clears the tallies.
|
|
var ops = SourceAssert.Text("ViewModels", "MainViewModel.Streaming.Operations.cs");
|
|
Assert.Contains("StartScoreboardSession();", ops);
|
|
}
|
|
}
|