From 3ad896930ace4dc2194873b3e6c23cefca7f289d Mon Sep 17 00:00:00 2001 From: Tig Date: Wed, 6 Nov 2024 14:23:52 -0700 Subject: [PATCH] WIP: adding superviewrenderslinecanvas tests --- UICatalog/Scenarios/AdvancedClipping.cs | 2 +- UnitTests/View/Adornment/BorderTests.cs | 55 +++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/UICatalog/Scenarios/AdvancedClipping.cs b/UICatalog/Scenarios/AdvancedClipping.cs index 306849c97f..8408867027 100644 --- a/UICatalog/Scenarios/AdvancedClipping.cs +++ b/UICatalog/Scenarios/AdvancedClipping.cs @@ -144,7 +144,7 @@ private View CreateTiledView (int id, Pos x, Pos y) CanFocus = true, // Can't drag without this? BUGBUG TabStop = TabBehavior.TabStop, Arrangement = ViewArrangement.Movable | ViewArrangement.Resizable, - ShadowStyle = ShadowStyle.Transparent + ShadowStyle = ShadowStyle.Transparent, }; //tiled.Padding.Thickness = new (1); //tiled.Padding.Diagnostics = ViewDiagnosticFlags.Thickness; diff --git a/UnitTests/View/Adornment/BorderTests.cs b/UnitTests/View/Adornment/BorderTests.cs index 15637d5078..9e74670f3a 100644 --- a/UnitTests/View/Adornment/BorderTests.cs +++ b/UnitTests/View/Adornment/BorderTests.cs @@ -821,4 +821,59 @@ public void View_SetBorderStyle () Assert.Equal (Thickness.Empty, view.Border.Thickness); view.Dispose (); } + + [Theory] + [InlineData (false, @" +┌───┐ +│ ║ │ +│═┌┄│ +│ ┊ │ +└───┘")] + [InlineData (true, @" +╔═╗─┐ +║ ║ │ +╚═╬┄┐ +│ ┊ ┊ +└─└┄┘")] + [SetupFakeDriver] + public void SuperViewRendersLineCanvas_AutoJoinsLines (bool superViewRendersLineCanvas, string expected) + { + View superView = new View () + { + Id = "superView", + Width = 5, + Height = 5, + BorderStyle = LineStyle.Single + }; + + View view1 = new View () + { + Id = "view1", + Width = 3, + Height = 3, + X = -1, + Y = -1, + BorderStyle = LineStyle.Double, + SuperViewRendersLineCanvas = superViewRendersLineCanvas + }; + + View view2 = new View () + { + Id = "view2", + Width = 3, + Height = 3, + X = 1, + Y = 1, + BorderStyle = LineStyle.Dotted, + SuperViewRendersLineCanvas = superViewRendersLineCanvas + }; + + superView.Add (view1, view2); + + superView.BeginInit (); + superView.EndInit (); + superView.Draw (); + + TestHelpers.AssertDriverContentsAre (expected, output); + } }