Esempio n. 1
0
        public void AddLinkedParameters(IReadOnlyList <ParameterSelection> parameterSelections)
        {
            if (_identificationParameter == null)
            {
                return;
            }

            Do.Action(() => parameterSelections.Each(addParameterToIdentificationParameter))
            .ThenFinally(Refresh);
        }
Esempio n. 2
0
        public void TypeText_PressShiftAndArrowLeftSevenTimes_SelectsPartOfTheText()
        {
            KeyboardEx.TypeText(_textBox, "Peter Sausage");
            DynamicSleep.Wait(1000);

            Do.Action(() => KeyboardEx.TypeKey(Key.Left, ModifierKeys.Shift)).Repeat(6).And.Wait(500);

            Assert.AreEqual("Sausage", _textBox.SelectedText);
            _textBox.Unsafe.SetValue("");
        }
Esempio n. 3
0
        public void Action_ThreeTimes_AllGotCalledOnce()
        {
            var firstExecutionCount  = 0;
            var secondExecutionCount = 0;
            var thirdExecutionCount  = 0;

            Do.Action(() => { ++firstExecutionCount; })
            .And.Action(() => { ++secondExecutionCount; })
            .And.Action(() => { ++thirdExecutionCount; });

            Assert.AreEqual(1, firstExecutionCount);
            Assert.AreEqual(1, secondExecutionCount);
            Assert.AreEqual(1, thirdExecutionCount);
        }
Esempio n. 4
0
        public void Action_ThreeTimesAndTwoRepeat_AllGotCalledThreeTimes()
        {
            var firstExecutionCount  = 0;
            var secondExecutionCount = 0;
            var thirdExecutionCount  = 0;

            Do.Action(() => { ++firstExecutionCount; })
            .And.Action(() => { ++secondExecutionCount; })
            .And.Action(() => { ++thirdExecutionCount; })
            .Repeat(2);

            Assert.AreEqual(3, firstExecutionCount);
            Assert.AreEqual(3, secondExecutionCount);
            Assert.AreEqual(3, thirdExecutionCount);
        }
Esempio n. 5
0
        public void Action_ThreeTimesWithTwoRepeatAndTwoWithFourRepeats_CallsActionsAccordingly()
        {
            var firstExecutionCount  = 0;
            var secondExecutionCount = 0;
            var thirdExecutionCount  = 0;
            var fourthExecutionCount = 0;
            var fifthExecutionCount  = 0;

            Do.Action(() => { ++firstExecutionCount; })
            .And.Action(() => { ++secondExecutionCount; })
            .And.Action(() => { ++thirdExecutionCount; })
            .Repeat(2)
            .And.Action(() => { ++fourthExecutionCount; })
            .And.Action(() => { ++fifthExecutionCount; })
            .Repeat(4);

            Assert.AreEqual(3, firstExecutionCount);
            Assert.AreEqual(3, secondExecutionCount);
            Assert.AreEqual(3, thirdExecutionCount);
            Assert.AreEqual(5, fourthExecutionCount);
            Assert.AreEqual(5, fifthExecutionCount);
        }