prep for Dialog to use Dim.Auto - Simplify unit tests to not depend on things not important to the unit test (like Dialog)

This commit is contained in:
Tig Kindel
2023-12-18 10:40:47 -07:00
parent 42f93cdded
commit 8274451805
5 changed files with 206 additions and 220 deletions

View File

@@ -935,7 +935,8 @@ namespace Terminal.Gui.ViewsTests {
│ │
└──────────────────┘", output);
var dialog = new Dialog () { X = 2, Y = 2, Width = 15, Height = 4 };
// Don't use Dialog here as it has more layout logic. Use Window instead.
var dialog = new Window () { X = 2, Y = 2, Width = 15, Height = 4 };
dialog.Add (new TextField ("Test") { X = Pos.Center (), Width = 10 });
var rs = Application.Begin (dialog);
@@ -992,8 +993,9 @@ namespace Terminal.Gui.ViewsTests {
Assert.Equal (new Rect (0, 0, 20, 15), Application.Driver.Clip);
TestHelpers.AssertDriverContentsWithFrameAre ("", output);
var dialog = new Dialog () { X = 2, Y = 2, Width = 15, Height = 4 };
// Don't use Dialog here as it has more layout logic. Use Window instead.
var dialog = new Window () { X = 2, Y = 2, Width = 15, Height = 4 };
dialog.Add (new TextField ("Test") { X = Pos.Center (), Width = 10 });
var rs = Application.Begin (dialog);