protected void AddFlowElement(TestFlowElement item) { if (_startElement == null) { SetStartNode(item); } ((Flowchart)ProductActivity).Nodes.Add(item.GetProductElement()); }
protected bool RemoveFlowElementItem(TestFlowElement item) { return(((Flowchart)ProductActivity).Nodes.Remove(item.GetProductElement())); }
/// <summary> /// Update the activity to execute of the given caseExpression/caseIndex /// </summary> /// <param name="caseExpression">used for locating the case in the product</param> /// <param name="caseIndex">used for locating the case in the test object</param> /// <param name="newElement">new node to be added to FlowSwitch</param> internal void UpdateCase(T caseExpression, int caseIndex, TestFlowElement newElement) { if (caseIndex < 0 || caseIndex >= this.caseElements.Count) { throw new ArgumentException("Given caseIndex is out of range."); } if (caseExpression == null) { throw new ArgumentException("Given caseExpression is null."); } if (!(this.productFlowSwitch as FlowSwitch <T>).Cases.ContainsKey(caseExpression)) { throw new ArgumentException("Given caseExpression cannot be found in the set of cases."); } (this.productFlowSwitch as FlowSwitch <T>).Cases[caseExpression] = (newElement == null) ? null : newElement.GetProductElement(); this.caseElements.RemoveAt(caseIndex); this.caseElements.Insert(caseIndex, newElement); }
private void SetStartNode(TestFlowElement startElement) { _startElement = startElement; ((Flowchart)ProductActivity).StartNode = startElement.GetProductElement(); }
internal void AddCase(T expression, TestFlowElement element) { (this.productFlowSwitch as FlowSwitch <T>).Cases.Add(expression, element == null ? null : element.GetProductElement()); this.caseElements.Add(element); }