Esempio n. 1
0
        public void GivenViewWithNoOtherElementInHost_WhenReturnKeyPressed_ThenFocusNotMoved()
        {
            // Given
            var textBox = new TextBox();

            TextBoxMoveFocusOnModification.Create(textBox);

            new Window
            {
                Content = new StackPanel
                {
                    Children =
                    {
                        textBox
                    }
                }
            }.Show();
            textBox.Focus();

            // Precondition
            Assert.That(textBox.IsFocused, Is.True);

            // When
            textBox.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice,
                                                Substitute.For <PresentationSource>(),
                                                0, Key.Return)
            {
                RoutedEvent = Keyboard.KeyDownEvent
            });

            // Then
            Assert.That(textBox.IsFocused, Is.True);
        }
Esempio n. 2
0
        public EngineSettingsTabView()
        {
            InitializeComponent();

            TextBoxModificationBinding.Create(ThrustPerEngineTextBox);
            TextBoxMoveFocusOnModification.Create(ThrustPerEngineTextBox);
        }
Esempio n. 3
0
        public void Create_TextBoxNull_ThrowsArgumentNullException()
        {
            // Call
            TestDelegate call = () => TextBoxMoveFocusOnModification.Create(null);

            // Assert
            Assert.That(call, Throws.ArgumentNullException
                        .With.Property(nameof(ArgumentNullException.ParamName))
                        .EqualTo("textBox"));
        }
        public GeneralSimulationSettingsTabView()
        {
            InitializeComponent();

            TextBoxModificationBinding.Create(MaximumNrOfIterationsTextBox);
            TextBoxMoveFocusOnModification.Create(MaximumNrOfIterationsTextBox);

            TextBoxModificationBinding.Create(TimeStepTextBox);
            TextBoxMoveFocusOnModification.Create(TimeStepTextBox);

            TextBoxModificationBinding.Create(EndFailureVelocityTextBox);
            TextBoxMoveFocusOnModification.Create(EndFailureVelocityTextBox);

            TextBoxModificationBinding.Create(DensityTextBox);
            TextBoxMoveFocusOnModification.Create(DensityTextBox);

            TextBoxModificationBinding.Create(GravitationalAccelerationTextBox);
            TextBoxMoveFocusOnModification.Create(GravitationalAccelerationTextBox);
        }
        public AircraftDataTabView()
        {
            InitializeComponent();

            TextBoxModificationBinding.Create(TakeOffWeightTextBox);
            TextBoxMoveFocusOnModification.Create(TakeOffWeightTextBox);

            TextBoxModificationBinding.Create(PitchGradientTextBox);
            TextBoxMoveFocusOnModification.Create(PitchGradientTextBox);

            TextBoxModificationBinding.Create(MaximumPitchAngleTextBox);
            TextBoxMoveFocusOnModification.Create(MaximumPitchAngleTextBox);

            TextBoxModificationBinding.Create(WingSurfaceAreaTextBox);
            TextBoxMoveFocusOnModification.Create(WingSurfaceAreaTextBox);

            TextBoxModificationBinding.Create(AspectRatioTextBox);
            TextBoxMoveFocusOnModification.Create(AspectRatioTextBox);

            TextBoxModificationBinding.Create(OswaldFactorTextBox);
            TextBoxMoveFocusOnModification.Create(OswaldFactorTextBox);

            TextBoxModificationBinding.Create(LiftCoefficientGradientTextBox);
            TextBoxMoveFocusOnModification.Create(LiftCoefficientGradientTextBox);

            TextBoxModificationBinding.Create(MaximumLiftCoefficientTextBox);
            TextBoxMoveFocusOnModification.Create(MaximumLiftCoefficientTextBox);

            TextBoxModificationBinding.Create(ZeroLiftAngleTextBox);
            TextBoxMoveFocusOnModification.Create(ZeroLiftAngleTextBox);

            TextBoxModificationBinding.Create(RestDragCoefficientTextBox);
            TextBoxMoveFocusOnModification.Create(RestDragCoefficientTextBox);

            TextBoxModificationBinding.Create(RestDragCoefficientWithEngineFailureTextBox);
            TextBoxMoveFocusOnModification.Create(RestDragCoefficientWithEngineFailureTextBox);

            TextBoxModificationBinding.Create(RollResistanceCoefficientTextBox);
            TextBoxMoveFocusOnModification.Create(RollResistanceCoefficientTextBox);

            TextBoxModificationBinding.Create(RollResistanceWithBrakesCoefficientTextBox);
            TextBoxMoveFocusOnModification.Create(RollResistanceWithBrakesCoefficientTextBox);
        }