Beispiel #1
0
        public void GivenLoadedActionWhenGettingDataThenActionAttributesMatch()
        {
            object[]            args   = { _model.Object, _data };
            ElementMoveUpAction action = new ElementMoveUpAction(args);

            Assert.AreEqual(1, action.Data.Count);
            Assert.AreEqual(ElementId.ToString(), _data["element"]);
        }
Beispiel #2
0
        public void WhenDoActionThenElementIsRemovedFromDataModel()
        {
            _model.Setup(x => x.PreviousSibling(_element.Object)).Returns(_previousElement.Object);

            ElementMoveUpAction action = new ElementMoveUpAction(_model.Object, _element.Object);

            action.Do();

            _model.Verify(x => x.Swap(_element.Object, _previousElement.Object), Times.Once());
        }
Beispiel #3
0
        public void WhenUndoActionThenElementIsRestoredInDataModel()
        {
            _model.Setup(x => x.NextSibling(_element.Object)).Returns(_previousElement.Object);

            ElementMoveUpAction action = new ElementMoveUpAction(_model.Object, _element.Object);

            action.Undo();

            _model.Verify(x => x.Swap(_previousElement.Object, _element.Object), Times.Once());
        }
Beispiel #4
0
        public void MoveUp(IDsmElement element)
        {
            ElementMoveUpAction action = new ElementMoveUpAction(_dsmModel, element);

            _actionManager.Execute(action);
        }