mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
This commit is contained in:
@@ -511,4 +511,66 @@ public class AdornmentTests (ITestOutputHelper output)
|
||||
bool result = adornment.Contains (new (pointX, pointY));
|
||||
Assert.Equal (expected, result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[SetupFakeDriver]
|
||||
public void Border_Is_Cleared_After_Margin_Thickness_Change ()
|
||||
{
|
||||
View view = new () { Text = "View", Width = 6, Height = 3, BorderStyle = LineStyle.Rounded };
|
||||
// Remove border bottom thickness
|
||||
view.Border!.Thickness = new (1, 1, 1, 0);
|
||||
// Add margin bottom thickness
|
||||
view.Margin!.Thickness = new (0, 0, 0, 1);
|
||||
|
||||
Assert.Equal (6, view.Width);
|
||||
Assert.Equal (3, view.Height);
|
||||
|
||||
view.Draw ();
|
||||
|
||||
TestHelpers.AssertDriverContentsWithFrameAre (
|
||||
@"
|
||||
╭────╮
|
||||
│View│
|
||||
",
|
||||
output
|
||||
);
|
||||
|
||||
// Add border bottom thickness
|
||||
view.Border!.Thickness = new (1, 1, 1, 1);
|
||||
// Remove margin bottom thickness
|
||||
view.Margin!.Thickness = new (0, 0, 0, 0);
|
||||
|
||||
view.Draw ();
|
||||
|
||||
Assert.Equal (6, view.Width);
|
||||
Assert.Equal (3, view.Height);
|
||||
|
||||
TestHelpers.AssertDriverContentsWithFrameAre (
|
||||
@"
|
||||
╭────╮
|
||||
│View│
|
||||
╰────╯
|
||||
",
|
||||
output
|
||||
);
|
||||
|
||||
// Remove border bottom thickness
|
||||
view.Border!.Thickness = new (1, 1, 1, 0);
|
||||
// Add margin bottom thickness
|
||||
view.Margin!.Thickness = new (0, 0, 0, 1);
|
||||
|
||||
Assert.Equal (6, view.Width);
|
||||
Assert.Equal (3, view.Height);
|
||||
|
||||
View.SetClipToScreen ();
|
||||
view.Draw ();
|
||||
|
||||
TestHelpers.AssertDriverContentsWithFrameAre (
|
||||
@"
|
||||
╭────╮
|
||||
│View│
|
||||
",
|
||||
output
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user