mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 07:47:54 +01:00
* Initial plan * Rename Slider to LinearRange - files and code updated Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix variable name mismatches in scenario files Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix typos in comments identified by code review Co-authored-by: tig <585482+tig@users.noreply.github.com> * Update HelpText for consistency with LinearRange rename Co-authored-by: tig <585482+tig@users.noreply.github.com> * Refactor LinearRange properties to use CWP with CWPPropertyHelper - Added CWP events (Changing/Changed) for Type, LegendsOrientation, MinimumInnerSpacing, ShowLegends, ShowEndSpacing, and UseMinimumSize properties - Used CWPPropertyHelper for consistent property change workflow - Added virtual OnChanging/OnChanged methods for each property - All existing tests pass Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix CWP property implementations - remove duplicate field updates in doWork - CWPPropertyHelper updates the ref parameter, so doWork should only contain side effects - Fixed Type, MinimumInnerSpacing, LegendsOrientation, ShowLegends, ShowEndSpacing, and UseMinimumSize - Added comprehensive CWP tests for property changes (9 new tests, all passing) - All 45 pre-existing LinearRange tests still pass (10 were already failing before changes) Co-authored-by: tig <585482+tig@users.noreply.github.com> * Add fluent integration tests for LinearRange - Created LinearRangeFluentTests with 5 test scenarios - Tests cover rendering, navigation, type changes with CWP events, range selection, and vertical orientation - All tests build successfully Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix unit tests and address review comments - Fixed review comments: Updated Title properties from "_Slider" to "_LinearRange" in DimAutoDemo and ViewportSettings - Fixed review comment: Renamed filterSlider to filterLinearRange in Mouse.cs - Fixed CWP implementation: Use local variable instead of backing field as ref parameter to CWPPropertyHelper - This ensures doWork can update the backing field BEFORE SetContentSize() reads it - All 55 LinearRange tests now passing (was 45/55, now 55/55) Co-authored-by: tig <585482+tig@users.noreply.github.com> * Update DimAutoDemo.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update ViewportSettings.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * code cleanup * Refactor LinearRanges scenario for clarity and modularity Refactored the LinearRanges scenario to separate UI setup, configuration, and event logic. The Main() method now handles all UI layout, configuration controls, and event wiring, while MakeSliders() is responsible only for adding LinearRange controls to the main window. Updated event handlers to use discard parameters for unused arguments and modernized code with collection initializers and LINQ. This results in a clearer separation of concerns and improved maintainability. * un did change * cleanup * cleanup * cleanup * fixed unit test code cleanup --------- Co-authored-by: Tig <tig@users.noreply.github.com> 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: Copilot <175728472+Copilot@users.noreply.github.com>
21 lines
555 B
C#
21 lines
555 B
C#
namespace ViewBaseTests.Adornments;
|
|
|
|
public class PaddingTests
|
|
{
|
|
[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);
|
|
}
|
|
}
|