public IList <ActionMenuItem> BuildMenuItems(TreeNode node) { var list = new List <ActionMenuItem>(); IEnumerable <ActionMenuItem> nodeItems = _screenObjects.BuildActions(node).Select(x => new ActionMenuItem(x)); IEnumerable <ActionMenuItem> subjectItems = _screenObjects.BuildActions(node.Subject).Select(x => new ActionMenuItem(x)); list.AddRange(nodeItems); list.AddRange(subjectItems); return(list); }
public void can_get_contextual_commands_for_a_TreeNode() { var node = new TreeNode(new Test("test1")); IEnumerable <IContextualAction> actions = _objectLocator.BuildActions(node); actions.Count(x => x is CollapseAllCommand).ShouldEqual(1); actions.Count(x => x is ExpandAllCommand).ShouldEqual(1); }