mirror of
https://github.com/AtomUI/AtomUI.git
synced 2026-10-25 02:30:32 +08:00
51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
using Avalonia;
|
|
using Shouldly;
|
|
using Xunit;
|
|
|
|
namespace AtomUI.Desktop.Controls.Tests.ButtonSpinnerTests;
|
|
|
|
public class ButtonSpinnerSpacingTests
|
|
{
|
|
[Fact]
|
|
public void Inline_Right_Handle_Preserves_Content_Right_Padding()
|
|
{
|
|
var decoratedBox = new TestButtonSpinnerDecoratedBox
|
|
{
|
|
IsShowHandle = true,
|
|
IsHandleFloatable = false,
|
|
ButtonSpinnerLocation = ButtonSpinnerLocation.Right,
|
|
SpinnerHandleWidth = 28,
|
|
ContentPadding = new Thickness(11, 4, 11, 4)
|
|
};
|
|
|
|
decoratedBox.RecalculateEffectiveContentPadding();
|
|
|
|
decoratedBox.EffectiveContentPadding.ShouldBe(new Thickness(11, 4, 39, 4));
|
|
}
|
|
|
|
[Fact]
|
|
public void Inline_Left_Handle_Preserves_Content_Left_Padding()
|
|
{
|
|
var decoratedBox = new TestButtonSpinnerDecoratedBox
|
|
{
|
|
IsShowHandle = true,
|
|
IsHandleFloatable = false,
|
|
ButtonSpinnerLocation = ButtonSpinnerLocation.Left,
|
|
SpinnerHandleWidth = 28,
|
|
ContentPadding = new Thickness(11, 4, 11, 4)
|
|
};
|
|
|
|
decoratedBox.RecalculateEffectiveContentPadding();
|
|
|
|
decoratedBox.EffectiveContentPadding.ShouldBe(new Thickness(39, 4, 11, 4));
|
|
}
|
|
|
|
private sealed class TestButtonSpinnerDecoratedBox : ButtonSpinnerDecoratedBox
|
|
{
|
|
public void RecalculateEffectiveContentPadding()
|
|
{
|
|
ConfigureEffectiveContentPadding();
|
|
}
|
|
}
|
|
}
|