mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-19 15:02:15 +01:00
fix(blackbox): the doors' sides as the driver has them, from the rear cab swapped
The recording holds the left and right of the vehicle, and from its rear cab the driver's left doors are the vehicle's right, as the simulator works them. The cab panel and the events showed the vehicle's sides, so after a change of direction to the other cab the doors opened on the wrong side. A change of the cab tells nothing of the doors in the events.
This commit is contained in:
31
StarterNG.Tests/BlackBox/CabDoorsTests.cs
Normal file
31
StarterNG.Tests/BlackBox/CabDoorsTests.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Eu07.BlackBox;
|
||||
|
||||
namespace StarterNG.Tests.BlackBox;
|
||||
|
||||
public class CabDoorsTests
|
||||
{
|
||||
private static CabSample Sample(sbyte cab, CabDevices devices) =>
|
||||
default(CabSample) with { CabEnd = cab, Devices = devices | CabDevices.Radio };
|
||||
|
||||
[Fact]
|
||||
public void From_the_rear_cab_the_vehicles_right_doors_are_the_drivers_left()
|
||||
{
|
||||
var seen = Sample(-1, CabDevices.DoorsRight | CabDevices.DoorPermitRight).AsTheCabSees;
|
||||
|
||||
Assert.True(seen.Has(CabDevices.DoorsLeft));
|
||||
Assert.True(seen.Has(CabDevices.DoorPermitLeft));
|
||||
Assert.False(seen.Has(CabDevices.DoorsRight));
|
||||
Assert.False(seen.Has(CabDevices.DoorPermitRight));
|
||||
Assert.True(seen.Has(CabDevices.Radio));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(1)]
|
||||
[InlineData(0)]
|
||||
public void From_the_front_cab_or_out_of_one_the_sides_are_the_vehicles(sbyte cab)
|
||||
{
|
||||
var sample = Sample(cab, CabDevices.DoorsLeft | CabDevices.DoorPermitRight);
|
||||
|
||||
Assert.Equal(sample, sample.AsTheCabSees);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user