コード例 #1
0
        public void WhenUndoActionThenElementTypeIsRevertedDataModel()
        {
            ElementChangeTypeAction action = new ElementChangeTypeAction(_model.Object, _element.Object, NewType);

            action.Undo();

            _model.Verify(x => x.ChangeElementType(_element.Object, OldType), Times.Once());
        }
コード例 #2
0
        public void GivenLoadedActionWhenGettingDataThenActionAttributesMatch()
        {
            object[] args = { _model.Object, _data };
            ElementChangeTypeAction action = new ElementChangeTypeAction(args);

            Assert.AreEqual(3, action.Data.Count);
            Assert.AreEqual(ElementId.ToString(), _data["element"]);
            Assert.AreEqual(OldType, _data["old"]);
            Assert.AreEqual(NewType, _data["new"]);
        }
コード例 #3
0
        public void ChangeElementType(IDsmElement element, string type)
        {
            ElementChangeTypeAction action = new ElementChangeTypeAction(_dsmModel, element, type);

            _actionManager.Execute(action);
        }