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

@@ -222,6 +222,34 @@ public class BlackBoxViewsTests
Assert.Equal(cab.Said, Controls.Peer(cab).GetHelpText());
}
[Fact]
public void Wheels_turning_apart_from_the_train_are_said_beside_its_speed()
{
var f = new BlackBoxFile().Info()
.Vehicle(Head, "EU07-005", "ROJ1")
.User(0, Head, true, 1);
// slipping for the first ten seconds, then the wheels as fast as the train, give or take the rounding
for (double t = 0; t <= 20; t += 0.5)
f.Cab(t, Head, 1150 + t * 10, 40, movement: 1, equippedHead: 0x15, equippedTail: 0x22, engine: 1,
wheelSpeed: t < 10 ? 55.4f : 40.3f);
var cab = new CabPanel
{
Recording = BlackBoxReader.Read(f.End(20).Stream()),
Strings = new DefaultBlackBoxStrings("en"),
Time = 5
};
Controls.Lay(cab, 600, 900);
Controls.Draw(cab);
Assert.Contains("40 km/h", cab.Said);
Assert.Contains("wheels 55", cab.Said);
cab.Time = 15;
Controls.Draw(cab);
Assert.Contains("40 km/h", cab.Said);
Assert.DoesNotContain("wheels", cab.Said);
}
[Fact]
public void The_cab_stopped_under_the_brakes_and_out_of_the_recording()
{