Skip to content

Commit f187543

Browse files
committed
test: add When_Padding
1 parent ace004c commit f187543

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_TextBlock.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,25 @@ public async Task When_TextTrimmingNone()
10011001
Assert.AreEqual(0, states.Count, $"IsTextTrimmedChanged should not proc at all. states: {(string.Join(", ", states) is string { Length: > 0 } tmp ? tmp : "(-empty-)")}");
10021002
}
10031003

1004+
[TestMethod]
1005+
public async Task When_Padding()
1006+
{
1007+
if (!ApiInformation.IsTypePresent("Microsoft.UI.Xaml.Media.Imaging.RenderTargetBitmap"))
1008+
{
1009+
Assert.Inconclusive("RenderTargetBitmap is not supported on this platform");
1010+
}
1011+
1012+
var SUT = new TextBlock
1013+
{
1014+
Text = "text",
1015+
Padding = new Thickness(50),
1016+
Foreground = new SolidColorBrush(Colors.Red),
1017+
};
1018+
await UITestHelper.Load(SUT);
1019+
var screenshot = await UITestHelper.ScreenShot(SUT);
1020+
ImageAssert.DoesNotHaveColorInRectangle(screenshot, new Rectangle(0, 0, 50, 50), Colors.Red);
1021+
}
1022+
10041023
#if HAS_UNO // GetMouse is not available on WinUI
10051024
#region IsTextSelectionEnabled
10061025

0 commit comments

Comments
 (0)