| 1 | using CascadeIDE.Cockpit.Composition.HostSurface; |
| 2 | using CascadeIDE.Models; |
| 3 | using Xunit; |
| 4 | |
| 5 | namespace CascadeIDE.Tests; |
| 6 | |
| 7 | public sealed class InstrumentStatusStripPlacementTests |
| 8 | { |
| 9 | [Fact] |
| 10 | public void IsZoneEnabled_whenKeyMissing_defaultsTrue() |
| 11 | { |
| 12 | var display = new DisplaySettings { Instruments = new Dictionary<string, string> { ["pfd_primary"] = "workspace_map" } }; |
| 13 | Assert.True(InstrumentStatusStripPlacement.IsVisibleOnPfd(display, masterEnabled: true)); |
| 14 | } |
| 15 | |
| 16 | [Fact] |
| 17 | public void IsZoneEnabled_whenNone_hidesStrip() |
| 18 | { |
| 19 | var display = new DisplaySettings |
| 20 | { |
| 21 | Instruments = new Dictionary<string, string> |
| 22 | { |
| 23 | [InstrumentRoutingSlotKeys.ForwardStatusStrip] = InstrumentStatusStripRouting.None, |
| 24 | }, |
| 25 | }; |
| 26 | Assert.False(InstrumentStatusStripPlacement.IsVisibleOnForward(display, masterEnabled: true)); |
| 27 | } |
| 28 | |
| 29 | [Fact] |
| 30 | public void IsZoneEnabled_whenBackgroundStatus_showsStrip() |
| 31 | { |
| 32 | var display = new DisplaySettings |
| 33 | { |
| 34 | Instruments = new Dictionary<string, string> |
| 35 | { |
| 36 | [InstrumentRoutingSlotKeys.PfdStatusStrip] = "background_status", |
| 37 | }, |
| 38 | }; |
| 39 | Assert.True(InstrumentStatusStripPlacement.IsVisibleOnPfd(display, masterEnabled: true)); |
| 40 | } |
| 41 | |
| 42 | [Fact] |
| 43 | public void MasterDisabled_hidesRegardlessOfRouting() |
| 44 | { |
| 45 | var display = new DisplaySettings |
| 46 | { |
| 47 | Instruments = new Dictionary<string, string> |
| 48 | { |
| 49 | [InstrumentRoutingSlotKeys.PfdStatusStrip] = "background_status", |
| 50 | }, |
| 51 | }; |
| 52 | Assert.False(InstrumentStatusStripPlacement.IsVisibleOnPfd(display, masterEnabled: false)); |
| 53 | } |
| 54 | } |
| 55 | |