Adds more unit tests for minimum full border without Left and Right thickness.

This commit is contained in:
BDisp
2023-12-04 12:10:36 +00:00
parent 6db8ccd2a9
commit 6d5754c22f
2 changed files with 30 additions and 4 deletions

View File

@@ -217,7 +217,7 @@ namespace Terminal.Gui {
var drawTop = Thickness.Top > 0 && Frame.Width > 1 && Frame.Height > 0;
var drawLeft = Thickness.Left > 0 && (Frame.Height > 1 || Thickness.Top == 0);
var drawBottom = Thickness.Bottom > 0 && Frame.Width > 1 && Frame.Height > 1;
var drawRight = Thickness.Right > 0 && ((Frame.Width > 1 && Frame.Height > 1) || Thickness.Top == 0);
var drawRight = Thickness.Right > 0 && ((Frame.Width > 0 && Frame.Height > 1) || Thickness.Top == 0);
var prevAttr = Driver.GetAttribute ();
if (ColorScheme != null) {

View File

@@ -347,6 +347,18 @@ t ", output);
└┘", output);
}
[Fact, AutoInitShutdown]
public void Draw_Minimum_Full_Border_Width_One_Height_One_Without_Top ()
{
var label = new Label () { Width = 1, Height = 1, BorderStyle = LineStyle.Single };
label.Border.Thickness = new Thickness (1, 0, 1, 1);
Application.Top.Add (label);
Application.Begin (Application.Top);
TestHelpers.AssertDriverContentsWithFrameAre (@"
││", output);
}
[Fact, AutoInitShutdown]
public void Draw_Minimum_Full_Border_Width_One_Height_One_Without_Bottom ()
{
@@ -360,15 +372,29 @@ t ", output);
}
[Fact, AutoInitShutdown]
public void Draw_Minimum_Full_Border_Width_One_Height_One_Without_Top ()
public void Draw_Minimum_Full_Border_Width_One_Height_One_Without_Left ()
{
var label = new Label () { Width = 1, Height = 1, BorderStyle = LineStyle.Single };
label.Border.Thickness = new Thickness (1, 0, 1, 1);
label.Border.Thickness = new Thickness (0, 1, 1, 1);
Application.Top.Add (label);
Application.Begin (Application.Top);
TestHelpers.AssertDriverContentsWithFrameAre (@"
│", output);
│", output);
}
[Fact, AutoInitShutdown]
public void Draw_Minimum_Full_Border_Width_One_Height_One_Without_Right ()
{
var label = new Label () { Width = 1, Height = 1, BorderStyle = LineStyle.Single };
label.Border.Thickness = new Thickness (1, 1, 0, 1);
Application.Top.Add (label);
Application.Begin (Application.Top);
TestHelpers.AssertDriverContentsWithFrameAre (@"
│", output);
}
[Fact, AutoInitShutdown]