public void AddLinkedParameters(IReadOnlyList <ParameterSelection> parameterSelections) { if (_identificationParameter == null) { return; } Do.Action(() => parameterSelections.Each(addParameterToIdentificationParameter)) .ThenFinally(Refresh); }
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(""); }
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); }
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); }
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); }