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,10 +1,9 @@
using UnitTests;
using UnitTests;
using Xunit.Abstractions;
namespace Terminal.Gui.LayoutTests;
public class AllViewsDrawTests (ITestOutputHelper _output) : TestsAllViews
public class AllViewsDrawTests (ITestOutputHelper output) : TestsAllViews
{
[Theory]
[SetupFakeDriver] // Required for spinner view that wants to register timeouts
@@ -19,12 +18,12 @@ public class AllViewsDrawTests (ITestOutputHelper _output) : TestsAllViews
if (view == null)
{
_output.WriteLine ($"Ignoring {viewType} - It's a Generic");
output.WriteLine ($"Ignoring {viewType} - It's a Generic");
return;
}
_output.WriteLine ($"Testing {viewType}");
output.WriteLine ($"Testing {viewType}");
if (view is IDesignable designable)
{
@@ -35,10 +34,10 @@ public class AllViewsDrawTests (ITestOutputHelper _output) : TestsAllViews
view.DrawComplete += (s, e) => drawCompleteCount++;
var layoutStartedCount = 0;
view.SubviewLayout += (s, e) => layoutStartedCount++;
view.SubViewLayout += (s, e) => layoutStartedCount++;
var layoutCompleteCount = 0;
view.SubviewsLaidOut += (s, e) => layoutCompleteCount++;
view.SubViewsLaidOut += (s, e) => layoutCompleteCount++;
view.SetNeedsLayout ();
view.Layout ();