Пример #1
0
        public void TestClickTwiceOnClearButton()
        {
            KeyBindingRow firstRow = null;

            AddStep("click first row", () =>
            {
                firstRow = panel.ChildrenOfType <KeyBindingRow>().First();
                InputManager.MoveMouseTo(firstRow);
                InputManager.Click(MouseButton.Left);
            });

            AddStep("schedule button clicks", () =>
            {
                var clearButton = firstRow.ChildrenOfType <KeyBindingRow.ClearButton>().Single();

                InputManager.MoveMouseTo(clearButton);

                int buttonClicks = 0;
                ScheduledDelegate clickDelegate = null;

                clickDelegate = Scheduler.AddDelayed(() =>
                {
                    InputManager.Click(MouseButton.Left);

                    if (++buttonClicks == 2)
                    {
                        // ReSharper disable once AccessToModifiedClosure
                        Debug.Assert(clickDelegate != null);
                        // ReSharper disable once AccessToModifiedClosure
                        clickDelegate.Cancel();
                    }
                }, 0, true);
            });
        }
Пример #2
0
 public void SetUpSteps()
 {
     AddUntilStep("wait for load", () => panel.ChildrenOfType <GlobalKeyBindingsSection>().Any());
     AddStep("Scroll to top", () => panel.ChildrenOfType <SettingsPanel.SettingsSectionsContainer>().First().ScrollToTop());
     AddWaitStep("wait for scroll", 5);
 }