| 1 | using CascadeIDE.Services.Presentation; |
| 2 | |
| 3 | using Xunit; |
| 4 | |
| 5 | |
| 6 | |
| 7 | namespace CascadeIDE.Tests; |
| 8 | |
| 9 | |
| 10 | |
| 11 | public sealed class PresentationCompactMainGridLayoutBuilderTests |
| 12 | |
| 13 | { |
| 14 | |
| 15 | [Fact] |
| 16 | |
| 17 | public void BuildRowDefinitions_cockpit_three_rows() |
| 18 | |
| 19 | { |
| 20 | |
| 21 | Assert.Equal("Auto,Auto,*", PresentationCompactMainGridLayoutBuilder.CockpitRowDefinitions); |
| 22 | |
| 23 | Assert.Equal( |
| 24 | |
| 25 | PresentationCompactMainGridLayoutBuilder.CockpitRowDefinitions, |
| 26 | |
| 27 | PresentationCompactMainGridLayoutBuilder.BuildRowDefinitions( |
| 28 | |
| 29 | intercomBottomVisible: false, |
| 30 | |
| 31 | mfdBottomVisible: false)); |
| 32 | |
| 33 | } |
| 34 | |
| 35 | |
| 36 | |
| 37 | [Fact] |
| 38 | |
| 39 | public void BuildRowDefinitions_single_bottom_dock_adds_splitter_row() |
| 40 | |
| 41 | { |
| 42 | |
| 43 | Assert.Equal( |
| 44 | |
| 45 | "Auto,Auto,*,4,Auto", |
| 46 | |
| 47 | PresentationCompactMainGridLayoutBuilder.BuildRowDefinitions( |
| 48 | |
| 49 | intercomBottomVisible: true, |
| 50 | |
| 51 | mfdBottomVisible: false)); |
| 52 | |
| 53 | Assert.Equal( |
| 54 | |
| 55 | "Auto,Auto,*,4,Auto", |
| 56 | |
| 57 | PresentationCompactMainGridLayoutBuilder.BuildRowDefinitions( |
| 58 | |
| 59 | intercomBottomVisible: false, |
| 60 | |
| 61 | mfdBottomVisible: true)); |
| 62 | |
| 63 | } |
| 64 | |
| 65 | |
| 66 | |
| 67 | [Fact] |
| 68 | |
| 69 | public void BuildRowDefinitions_dual_bottom_docks_stack_rows() |
| 70 | |
| 71 | { |
| 72 | |
| 73 | Assert.Equal( |
| 74 | |
| 75 | "Auto,Auto,*,4,Auto,4,Auto", |
| 76 | |
| 77 | PresentationCompactMainGridLayoutBuilder.BuildRowDefinitions( |
| 78 | |
| 79 | intercomBottomVisible: true, |
| 80 | |
| 81 | mfdBottomVisible: true)); |
| 82 | |
| 83 | } |
| 84 | |
| 85 | |
| 86 | |
| 87 | [Fact] |
| 88 | |
| 89 | public void BuildWithRightChromeWidth_zero_collapses_right_column() |
| 90 | |
| 91 | { |
| 92 | |
| 93 | var frame = PresentationCompactMainGridLayoutBuilder.BuildWithRightChromeWidth(0, 8); |
| 94 | |
| 95 | Assert.Equal("0,4,*,4,0", frame.ColumnDefinitions); |
| 96 | |
| 97 | Assert.Equal(1, frame.ContentZoneCount); |
| 98 | |
| 99 | } |
| 100 | |
| 101 | |
| 102 | |
| 103 | [Fact] |
| 104 | |
| 105 | public void BuildWithRightChromeWidth_positive_allocates_forward_and_right() |
| 106 | |
| 107 | { |
| 108 | |
| 109 | var frame = PresentationCompactMainGridLayoutBuilder.BuildWithRightChromeWidth(380, 8); |
| 110 | |
| 111 | Assert.Equal("0,4,*,4,380", frame.ColumnDefinitions); |
| 112 | |
| 113 | Assert.Equal(2, frame.ContentZoneCount); |
| 114 | |
| 115 | } |
| 116 | |
| 117 | } |
| 118 | |
| 119 | |
| 120 | |