Ejemplo n.º 1
0
        public void WhenDoActionThenElementsChilderenAreSorted()
        {
            ElementSortAction action = new ElementSortAction(_model.Object, _element.Object, UsedAlgorithm);

            action.Do();

            _model.Verify(x => x.ReorderChildren(_element.Object, It.Is <SortResult>(i => i.Data == SortResult)), Times.Once());
        }
Ejemplo n.º 2
0
        public void WhenUndoActionThenElementsChilderenAreSortIsReverted()
        {
            object[]          args   = { _model.Object, _data };
            ElementSortAction action = new ElementSortAction(args);

            action.Undo();

            _model.Verify(x => x.ReorderChildren(_element.Object, It.Is <SortResult>(i => i.Data == InverseSortResult)), Times.Once());
        }
Ejemplo n.º 3
0
        public void GivenLoadedActionWhenGettingDataThenActionAttributesMatch()
        {
            object[]          args   = { _model.Object, _data };
            ElementSortAction action = new ElementSortAction(args);

            Assert.AreEqual(3, action.Data.Count);
            Assert.AreEqual(ElementId.ToString(), _data["element"]);
            Assert.AreEqual(UsedAlgorithm, _data["algorithm"]);
            Assert.AreEqual(SortResult, _data["order"]);
        }
Ejemplo n.º 4
0
        public void Sort(IDsmElement element, string algorithm)
        {
            ElementSortAction action = new ElementSortAction(_dsmModel, element, algorithm);

            _actionManager.Execute(action);
        }