Exemple #1
0
        public void When_left_clicked_Then_only_an_Element_is_selected_and_focused()
        {
            //Arrange
            var clickStatus = new ClickStatusStub {
                IsLeftMouseButtonClicked = true
            };

            //Act
            var element = _selectableList.ElementAt(0);

            element.Click(clickStatus);

            //Assert
            Assert.IsTrue(element.IsSelected);
            Assert.IsTrue(element.IsFocused);
        }
Exemple #2
0
        public void When_right_clicked_Then_nothing_changed()
        {
            //Arrange
            var clickStatus = new ClickStatusStub {
                IsRightMouseButtonClicked = true
            };

            //Act
            var        element = _selectableList.ElementAt(0);
            const bool expectedSelectStatus = true;
            var        expectedFocusStatus  = !element.IsSelected || element.IsFocused;

            element.Click(clickStatus);

            //Assert
            Assert.AreEqual(expectedSelectStatus, element.IsSelected);
            Assert.AreEqual(expectedFocusStatus, element.IsFocused);
        }