test(tapes): the tapes window, the choice asked before a start, the wheels and the doors from the other cab

- HaslerTapeWindow: with nothing recorded it offers to record and turns on the
  black box and the trains' tapes; a tape of the last launch is summed up with
  its scenario and train, and is no longer followed once the window closes.
- HaslerTapes.Load: a log begun anew over the end that was read is read whole
  once its time goes back; an unreadable tape is none and told in the log; a
  file read only forward is read whole each time. Empty log lines are passed over.
- MessageBox.Choose: the answer clicked, or none on the way back or on closing.
- CabPanel: wheels turning apart from the train are said beside its speed.
- EventList: going to the other cab tells nothing of the doors, still the switches.
- WarehouseEditTests and ConsistOrientationTests put in app-wide services of
  their own: they now wait their turn with the controls that read them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maj00r
2026-11-16 15:58:31 +01:00
parent fa8ae760e1
commit f0fa2d1768
9 changed files with 335 additions and 3 deletions

View File

@@ -1,7 +1,10 @@
using Eu07.BlackBox;
using Eu07.BlackBox.Views;
namespace StarterNG.Tests.BlackBox;
// The events are coloured with the views' brushes.
[Collection(AvaloniaControls.Name)]
public class CabDoorsTests
{
private static CabSample Sample(sbyte cab, CabDevices devices) =>
@@ -28,4 +31,19 @@ public class CabDoorsTests
Assert.Equal(sample, sample.AsTheCabSees);
}
[Fact]
public void Going_to_the_other_cab_tells_nothing_of_the_doors_and_still_tells_the_switches()
{
var f = new BlackBoxFile().Info().Vehicle(1, "EN57-1001").User(0, 1, true);
// the left doors permitted from the front cab; in the rear one the permit is still on, and the radio turned off
f.Cab(0, 1, 1000, 0, cabEnd: 1, devices: 0x0007 | (uint)(CabDevices.DoorPermitLeft | CabDevices.Radio));
f.Cab(1, 1, 1000, 0, cabEnd: -1, devices: 0x0007 | (uint)CabDevices.DoorPermitLeft);
var events = EventList.Collect(BlackBoxReader.Read(f.End(1).Stream()), new DefaultBlackBoxStrings("en"))
.Select(e => e.Text).ToList();
Assert.Contains("Radio: off", events);
Assert.DoesNotContain(events, e => e.Contains("doors permitted"));
}
}