mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
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:
@@ -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 ();
|
||||
|
||||
Reference in New Issue
Block a user