A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

28 lines
826 B

using Avalonia.Automation;
using Avalonia.Automation.Peers;
using Avalonia.Automation.Provider;
using Avalonia.UnitTests;
using Xunit;
namespace Avalonia.Controls.UnitTests.Automation;
public class ScrollViewerAutomationPeerTests : ScopedTestBase
{
[Fact]
public void SetScrollPercent_Preserves_Style_Binding()
{
var target = new ScrollViewer
{
Extent = new Size(100, 1000),
Viewport = new Size(100, 100),
};
var peer = (IScrollProvider)ControlAutomationPeer.CreatePeerForElement(target);
AutomationPeerAssert.PreservesStyleBinding(
target,
ScrollViewer.OffsetProperty,
new Vector(0, 100),
new Vector(0, 450),
() => peer.SetScrollPercent(ScrollPatternIdentifiers.NoScroll, 50));
}
}