diff --git a/UnitTests/View/Layout/SetLayoutTests.cs b/UnitTests/View/Layout/SetLayoutTests.cs index 7cfc5cb0c..d348fe2b1 100644 --- a/UnitTests/View/Layout/SetLayoutTests.cs +++ b/UnitTests/View/Layout/SetLayoutTests.cs @@ -812,111 +812,4 @@ public class SetLayoutTests (ITestOutputHelper output) Assert.Equal (19, v2.Frame.Height); t.Dispose (); } - - - // BUGBUG: This is NOT a SetLayoutTest but a Border and SuperViewRendersLineCanvas test - // BUGBUG: Please move this to a more appropriate test class - // BUGBUG: It also tests multiple things and it's not clear what it's really testing. - // BUGBUG: Simplfiy it and break it into separate tests that each test ONE thing. - [Fact] - [SetupFakeDriver] - public void Pos_Right_With_Adornments () - { - View view1 = new () { Text = "View1", Width = 7, Height = 3, BorderStyle = LineStyle.Rounded }; - View view2 = new () { Text = "View2", X = Pos.Right (view1) - 1, Width = 7, Height = 3, BorderStyle = LineStyle.Rounded }; - View view3 = new () { Text = "View3", X = Pos.Right (view2) - 1, Width = 7, Height = 3, BorderStyle = LineStyle.Rounded }; - View container = new () { Width = Dim.Fill (), Height = 3 }; - container.Add (view1, view2, view3); - - View view4 = new () { Text = "View4", Y = Pos.Bottom (container), Width = 21, Height = 3, BorderStyle = LineStyle.Rounded }; - View superView = new () { Width = Dim.Fill (), Height = Dim.Fill () }; - superView.Add (container, view4); - - superView.Layout (); - superView.Draw (); - - TestHelpers.AssertDriverContentsAre ( - @" -╭─────╭─────╭─────╮ -│View1│View2│View3│ -╰─────╰─────╰─────╯ -╭───────────────────╮ -│View4 │ -╰───────────────────╯ -", - output - ); - - // Remove border bottom from the view1 - view1.Border!.Thickness = new (1, 1, 1, 0); - // Insert margin bottom into the view1 - view1.Margin!.Thickness = new (0, 0, 0, 1); - - View.SetClipToScreen (); - superView.Draw (); - - TestHelpers.AssertDriverContentsAre ( - @" -╭─────╭─────╭─────╮ -│View1│View2│View3│ - ╰─────╰─────╯ -╭───────────────────╮ -│View4 │ -╰───────────────────╯ -", - output - ); - - // Restore view1 border - view1.Border.Thickness = new (1); - // Restore view1 margin - view1.Margin.Thickness = Thickness.Empty; - - // Remove border bottom from the view2 - view2.Border!.Thickness = new (1, 1, 1, 0); - // Insert margin bottom into the view2 - view2.Margin!.Thickness = new (0, 0, 0, 1); - - View.SetClipToScreen (); - superView.Draw (); - - TestHelpers.AssertDriverContentsAre ( - @" -╭─────╭─────╭─────╮ -│View1│View2│View3│ -╰─────╯ ╰─────╯ -╭───────────────────╮ -│View4 │ -╰───────────────────╯ -", - output - ); - - // Restore view2 border - view2.Border.Thickness = new (1); - // Restore view2 margin - view2.Margin.Thickness = Thickness.Empty; - - // Remove border bottom from the view3 - view3.Border!.Thickness = new (1, 1, 1, 0); - // Insert margin bottom into the view3 - view3.Margin!.Thickness = new (0, 0, 0, 1); - - View.SetClipToScreen (); - superView.Draw (); - - TestHelpers.AssertDriverContentsAre ( - @" -╭─────╭─────╭─────╮ -│View1│View2│View3│ -╰─────╰─────╯ -╭───────────────────╮ -│View4 │ -╰───────────────────╯ -", - output - ); - - superView.Dispose (); - } }