예제 #1
0
        [Test] public void MouseCtrlSelect()
        {
            JetListViewNode item  = _nodeCollection.Add("Item1");
            JetListViewNode item2 = _nodeCollection.Add("Item2");

            _model.HandleMouseDown(item, Keys.None);
            _model.HandleMouseDown(item2, Keys.Control);
            _model.HandleMouseUp(item2, Keys.Control);

            Assert.IsTrue(_model.IsNodeSelected(item));
            Assert.IsTrue(_model.IsNodeSelected(item2));
            Assert.IsFalse(_model.IsNodeFocused(item));
            Assert.IsTrue(_model.IsNodeFocused(item2));

            _model.HandleMouseDown(item2, Keys.Control);
            Assert.IsTrue(_model.IsNodeSelected(item2));
            _model.HandleMouseUp(item2, Keys.Control);
            Assert.IsFalse(_model.IsNodeSelected(item2));
        }