Files
Terminal.Gui/Tests/UnitTests/View/Adornment/PaddingTests.cs
Tig fdeaa8331b Fixes #4298 - Updates test namespaces (#4299)
* Refactored test namespaces.
Moved some tests that were in wrong project.
Code cleanup

* Parrallel -> Parallel
2025-10-20 14:14:38 -06:00

39 lines
1.2 KiB
C#

using UnitTests;
using Xunit.Abstractions;
namespace UnitTests.ViewTests;
public class PaddingTests (ITestOutputHelper output)
{
[Fact]
[SetupFakeDriver]
public void Padding_Uses_Parent_Scheme ()
{
((IFakeConsoleDriver)Application.Driver!).SetBufferSize (5, 5);
var view = new View { Height = 3, Width = 3 };
view.Padding!.Thickness = new (1);
view.Padding.Diagnostics = ViewDiagnosticFlags.Thickness;
view.SetScheme (new()
{
Normal = new (Color.Red, Color.Green), Focus = new (Color.Green, Color.Red)
});
Assert.Equal (ColorName16.Red, view.Padding.GetAttributeForRole (VisualRole.Normal).Foreground.GetClosestNamedColor16 ());
Assert.Equal (view.GetAttributeForRole (VisualRole.Normal), view.Padding.GetAttributeForRole (VisualRole.Normal));
view.BeginInit ();
view.EndInit ();
view.Draw ();
DriverAssert.AssertDriverContentsAre (
@"
PPP
P P
PPP",
output
);
DriverAssert.AssertDriverAttributesAre ("0", output, null, view.GetAttributeForRole (VisualRole.Normal));
}
}