Preventing more Update execution before Initialize.

This commit is contained in:
BDisp
2022-05-18 13:47:04 +01:00
parent c561016423
commit d99bc42f39
3 changed files with 48 additions and 36 deletions

View File

@@ -3182,36 +3182,6 @@ e
Assert.Equal (15, TextFormatter.GetMaxLengthForWidth (runes, 16));
}
[Fact, AutoInitShutdown]
public void GetMaxLengthForWidth_On_Button ()
{
var btn = new Button ("Say Hello 你") {
X = Pos.Center (),
Y = Pos.Center ()
};
var win = new Window ("Test Demo 你") {
Width = Dim.Fill (),
Height = Dim.Fill ()
};
win.Add (btn);
Application.Top.Add (win);
Application.Begin (Application.Top);
((FakeDriver)Application.Driver).SetBufferSize (30, 5);
Assert.Equal (new Rect (0, 0, 16, 1), btn.Bounds);
var expected = @"
┌ Test Demo 你 ──────────────┐
│ │
│ [ Say Hello 你 ] │
│ │
└────────────────────────────┘
";
var pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
Assert.Equal (new Rect (0, 0, 30, 5), pos);
}
[Fact]
public void Format_Truncate_Simple_And_Wide_Runes ()
{