Cleans up/Refactors View.Subviews (#3962)

* Subview clean up

* New Add/Remove event pattern

* Using Logging

* cleanup

* Subview -> SubView

* Test code cleanup. Killed many warnings.

* Fix tznind feedback

* Refactored AllViewTest helpers

* Moved keyboard tests to parallel

* Moved mouse tests to parallel

* Moved view tests to parallel

* Test code cleanup. Killed many warnings.

* dupe test

* Some mouse tests can't run in parallel because MouseGrabView

* Made SpinnerView more testable

* Moved more tests

* SubViews to IReadOnlyCollection<View>

* SubViews to IReadOnlyCollection<View> 2

* scrollbar tests

* shortcut tests

* Use InternalSubViews vs. _subviews

* Nuked View.IsAdded.
Added View.SuperViewChanged.

* API doc updats

* Unit Test tweak

* Unit Test tweak
This commit is contained in:
Tig
2025-03-08 15:42:17 -07:00
committed by GitHub
parent 85cf6619ed
commit acb5979e6c
226 changed files with 7235 additions and 7188 deletions

View File

@@ -1,7 +1,4 @@
using System.Runtime.CompilerServices;
using System.Text;
using UnitTests;
using UnitTests;
using UnitTests;
using Xunit.Abstractions;
namespace Terminal.Gui.ViewTests;
@@ -11,7 +8,6 @@ namespace Terminal.Gui.ViewTests;
/// </summary>
public class TextTests (ITestOutputHelper output)
{
[Fact]
[SetupFakeDriver]
public void Setting_With_Height_Horizontal ()
@@ -27,7 +23,7 @@ public class TextTests (ITestOutputHelper output)
Assert.Equal (new (0, 0, 5, 1), label.Frame);
top.LayoutSubviews ();
top.LayoutSubViews ();
top.Draw ();
var expected = @"
@@ -42,7 +38,7 @@ Y
Assert.Equal (new (0, 0, 10, 2), label.Frame);
top.LayoutSubviews ();
top.LayoutSubViews ();
View.SetClipToScreen ();
top.Draw ();
@@ -459,7 +455,7 @@ Y
Height = Dim.Auto ()
};
view.SetRelativeLayout (new Size (4, 10));
view.SetRelativeLayout (new (4, 10));
Assert.Equal (5, text.Length);
@@ -714,6 +710,7 @@ w ";
Application.End (rs);
top.Dispose ();
}
[Theory]
[AutoInitShutdown]
[InlineData (true)]
@@ -997,7 +994,6 @@ w ";
top.Dispose ();
}
[Fact]
[SetupFakeDriver]
public void Narrow_Wide_Runes ()