public void NotifyScrollValueChanged_ScrollerInactive_StaysDeactivated() { AutoScroller autoScroller = CreateAutoScroller( out IScrollView scrollView, out IRectangle content, out IActivateable elementToStartScroller); autoScroller.ScrollerActive = false; autoScroller.NotifyScrollValueChanged(); Assert.False(autoScroller.ScrollerActive); }
public void NotifyScrollValueChanged_UserScrolled_DeactivatesScroller() { AutoScroller autoScroller = CreateAutoScroller( out IScrollView scrollView, out IRectangle content, out IActivateable elementToStartScroller); autoScroller.ScrollerActive = true; // no changes to content size => manual scrolling autoScroller.NotifyScrollValueChanged(); Assert.False(autoScroller.ScrollerActive); }
public void NotifyScrollValueChanged_ScrollerInactiveContentSizeChanged_NoScrollToBottom() { AutoScroller autoScroller = CreateAutoScroller( out IScrollView scrollView, out IRectangle content, out IActivateable elementToStartScroller); autoScroller.ScrollerActive = false; content.Size = Vector2.one; scrollView.NormalizedPosition = Vector2.one; autoScroller.NotifyScrollValueChanged(); Assert.AreEqual(1, scrollView.NormalizedPosition.y); }
public void NotifyScrollValueChanged_ContentSizeChanged_KeepsScrollerActive() { AutoScroller autoScroller = CreateAutoScroller( out IScrollView scrollView, out IRectangle content, out IActivateable elementToStartScroller); autoScroller.ScrollerActive = true; content.Size = Vector2.one; // changes to content size => no manual scrolling autoScroller.NotifyScrollValueChanged(); Assert.True(autoScroller.ScrollerActive); }
public void NotifyScrollValueChanged_ContentSizeChanged_ScrollToBottom() { AutoScroller autoScroller = CreateAutoScroller( out IScrollView scrollView, out IRectangle content, out IActivateable elementToStartScroller); autoScroller.ScrollerActive = true; content.Size = Vector2.one; scrollView.NormalizedPosition = Vector2.one; // changes to content size => no manual scrolling autoScroller.NotifyScrollValueChanged(); Assert.AreEqual(0, scrollView.NormalizedPosition.y); }