|
@@ -5,42 +5,7 @@ namespace Terminal.Gui.ViewTests;
|
|
|
|
|
|
public class TitleTests (ITestOutputHelper output)
|
|
|
{
|
|
|
- [SetupFakeDriver]
|
|
|
- [Fact]
|
|
|
- public void Change_View_Size_Update_Title_Size ()
|
|
|
- {
|
|
|
- var view = new View
|
|
|
- {
|
|
|
- Title = "_Hello World",
|
|
|
- Width = Dim.Auto (),
|
|
|
- Height = Dim.Auto (),
|
|
|
- BorderStyle = LineStyle.Single
|
|
|
- };
|
|
|
- var top = new Toplevel ();
|
|
|
- top.Add (view);
|
|
|
- top.BeginInit ();
|
|
|
- top.EndInit ();
|
|
|
-
|
|
|
- Assert.Equal (string.Empty, view.Text);
|
|
|
- Assert.Equal (new (2, 2), view.Frame.Size);
|
|
|
- top.Draw ();
|
|
|
-
|
|
|
- TestHelpers.AssertDriverContentsWithFrameAre (
|
|
|
- @"
|
|
|
-┌┐
|
|
|
-└┘",
|
|
|
- output);
|
|
|
-
|
|
|
- var text = "This text will increment the view size and display the title.";
|
|
|
- view.Text = text;
|
|
|
- top.Draw ();
|
|
|
- Assert.Equal (text, view.Text);
|
|
|
-
|
|
|
- // SetupFakeDriver only create a screen with 25 cols and 25 rows
|
|
|
- Assert.Equal (new (25, 3), view.GetContentSize ());
|
|
|
-
|
|
|
- top.Dispose ();
|
|
|
- }
|
|
|
+ // Unit tests that verify look & feel of title are in BorderTests.cs
|
|
|
|
|
|
[Fact]
|
|
|
public void Set_Title_Fires_TitleChanged ()
|