using Xunit; using ytLive.ViewModels; namespace ytLive.Tests; /// The LIP-SYNC bay re-houses the offset that shipped as TASK 22, with the two things the /// dock asks of it: a readable readout ("0 ms (aligned)") and 0 as a one-click detent. The offset /// itself is clamped and persisted by the existing property — this pins the surface. /// public class SyncBayTests { [Fact] public void The_lip_sync_bay_uses_the_persisted_offset_with_a_zero_detent() { var dock = SourceAssert.Text("Controls", "AudioDock.xaml"); Assert.Contains("Value=\"{Binding AudioSyncOffsetMs, Mode=TwoWay}\"", dock); Assert.Contains("Text=\"{Binding SyncOffsetLabel}\"", dock); Assert.Contains("Click=\"SyncPreset_Click\"", dock); Assert.Contains("Tag=\"0\"", dock); Assert.Contains("Minimum=\"-200\" Maximum=\"200\"", dock); // The readout names the good state, and signs the others the way a person reads them. Assert.Matches(@"IsSnapToTickEnabled=""True""", dock); var type = typeof(MainViewModel); Assert.NotNull(type.GetProperty("AudioSyncOffsetMs")); Assert.NotNull(type.GetProperty("SyncOffsetLabel")); Assert.NotNull(type.GetMethod("SetSyncOffset", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)); } }