Example #1
0
        public void IsContextMenuItemSelected_ReturnsTrue_WhenContextMenuItemIsSelected()
        {
            // Arrange
            ResultsViewModel rvm          = new ResultsViewModel();
            Result           result       = new Result();
            ResultViewModel  selectedItem = new ResultViewModel(result);

            selectedItem.ContextMenuItems.Add(new ContextMenuItemViewModel(null, null, null, null, Key.None, ModifierKeys.None, null));
            rvm.SelectedItem = selectedItem;

            // Act
            rvm.SelectNextContextMenuItem();
            bool isContextMenuItemSelected = rvm.IsContextMenuItemSelected();

            // Assert
            Assert.IsTrue(isContextMenuItemSelected);
        }
Example #2
0
        public void IsContextMenuItemSelected_ReturnsTrue_WhenContextMenuItemIsSelected()
        {
            // Arrange
            ResultsViewModel rvm          = new ResultsViewModel();
            Result           result       = new Result();
            ResultViewModel  selectedItem = new ResultViewModel(result);

            selectedItem.ContextMenuItems.Add(new ContextMenuItemViewModel()
            {
                Title = "Dummy Context Menu"
            });
            rvm.SelectedItem = selectedItem;

            // Act
            rvm.SelectNextContextMenuItem();
            bool isContextMenuItemSelected = rvm.IsContextMenuItemSelected();

            // Assert
            Assert.IsTrue(isContextMenuItemSelected);
        }