Files
Terminal.Gui/Tests/UnitTestsParallelizable/ViewBase/Adornment/PaddingTests.cs
Copilot 4145b984ba Fixes #2485 ++ - Wizard v2 architecture modernization with Padding-based layout (#4510)
* Initial plan

* Fix Wizard v2 architecture issues - ScrollBar API, event handlers, key bindings

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Implement issue #4155 - Put nav buttons in bottom Padding, Help in right Padding

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Address code review feedback - Extract helper method, improve null checks

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix disposal issue - Ensure _helpTextView is always disposed

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Refactor & improvements. WIP

* Tweaking layout

* Wizard tweaks

* Added View.GetSubViews that optinoally gets subviews of adornments

* Refactor Wizard API: modern events, layout, and design

- Replaced custom event args with standard .NET event args (CancelEventArgs, ValueChangingEventArgs, etc.)
- Removed Finished event; use Accepting for wizard completion
- Updated Cancelled, MovingBack, MovingNext to use CancelEventArgs
- Refactored UICatalog scenarios and tests to new event model
- Improved WizardStep sizing and wizard auto-resizing to content
- Enhanced IDesignable for Wizard and WizardStep with richer design-time UI
- Simplified help text padding logic in WizardStep
- Removed obsolete code and modernized code style throughout
- Improves API consistency, usability, and .NET idiomatic usage

* Fixes #4515 - Navigating into and out of Adornments does not work

* WIP. QUite broken.

* All fixed?

* Tweaks.

* Exclude Margin subviews from drawing; add shadow tests

Update Margin adornment to skip drawing subviews that are themselves Margin views, preventing unsupported nested Margin rendering. Add unit tests to verify that opaque-shadowed buttons in Margin are not drawn, while Border and Padding still support shadow rendering. Update test class to use output helper and assert driver output.

* Final code cleanup and test improvements.

* Update Margin.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update View.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update View.Hierarchy.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update View.Hierarchy.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Refactor: code style, formatting, and minor logic cleanup

- Standardized spacing and formatting for method signatures and object initializations.
- Converted simple methods and properties to expression-bodied members for conciseness.
- Replaced named arguments with positional arguments for consistency.
- Improved XML documentation formatting for readability.
- Simplified logic in event handlers (e.g., Wizard Back button).
- Removed redundant checks where properties are guaranteed to exist.
- Fixed minor bugs related to padding, height calculation, and event handling.
- Adopted consistent use of `var` for local variables.
- Corrected namespace declarations.
- Refactored methods returning constants to use expression-bodied syntax.
- General code cleanup for clarity and maintainability; no breaking changes.

* api docs

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-21 07:42:04 -07:00

26 lines
644 B
C#

#nullable enable
using UnitTests;
using Xunit.Abstractions;
namespace ViewBaseTests.Adornments;
public class PaddingTests (ITestOutputHelper output)
{
[Fact]
public void Constructor_Defaults ()
{
View view = new () { Height = 3, Width = 3 };
Assert.True (view.Padding!.CanFocus);
Assert.Equal (TabBehavior.NoStop, view.Padding.TabStop);
Assert.Empty (view.Padding!.KeyBindings.GetBindings ());
}
[Fact]
public void Thickness_Is_Empty_By_Default ()
{
View view = new () { Height = 3, Width = 3 };
Assert.Equal (Thickness.Empty, view.Padding!.Thickness);
}
}