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()); }
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()); }
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"]); }
public void Sort(IDsmElement element, string algorithm) { ElementSortAction action = new ElementSortAction(_dsmModel, element, algorithm); _actionManager.Execute(action); }