public static void SetupWorkflowNodeHtml(this IWorkflowNode workflowNode, HtmlTextWriter writer, IWorkflowNode[] coveredNodes)
        {
            if (IsNodeCovered(coveredNodes, workflowNode))
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Color, "green");
                writer.AddStyleAttribute(HtmlTextWriterStyle.FontSize, "12px");
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "step-description-green");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.Write(workflowNode.StepDescription);
                writer.RenderEndTag();
            }
            else
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Color, "red");
                writer.AddStyleAttribute(HtmlTextWriterStyle.FontSize, "12px");
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "step-description-red");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.Write(workflowNode.StepDescription);
                writer.RenderEndTag();
            }

            if (workflowNode.NextNodes?.Count > 0)
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.FontSize, "12px");
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "next-nodes");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                workflowNode.NextNodes.ForEach(node => SetupNextNodeHTML(writer, coveredNodes, node));
                writer.RenderEndTag();
            }
        }
예제 #2
0
        /// <summary>
        /// Appends the workflow specified to this workflow as an operation
        /// </summary>
        /// <param name="Workflow">The workflow to append</param>
        /// <param name="Constraints">
        /// Determines if the operation should be run or if it should be skipped
        /// </param>
        /// <returns>The resulting workflow object</returns>
        public IWorkflow <T> Do(IWorkflow <T> Workflow, params IConstraint <T>[] Constraints)
        {
            IWorkflowNode <T> Node = Nodes.AddAndReturn(new WorkflowNode <T>());

            Node.AddOperation(Workflow, Constraints);
            return(this);
        }
예제 #3
0
 public void Add(IWorkflowNode node)
 {
     if (node != null)
     {
         NextNodes.Add(node);
     }
 }
예제 #4
0
        /// <summary>
        /// Causes multiple commands to be executed concurrently
        /// </summary>
        /// <param name="Workflow">The workflow to append</param>
        /// <param name="Constraints">
        /// Determines if the operation should be run or if it should be skipped
        /// </param>
        /// <returns>The resulting workflow object</returns>
        public IWorkflow <T> And(IWorkflow <T> Workflow, params IConstraint <T>[] Constraints)
        {
            IWorkflowNode <T> Node = Nodes.LastOrDefault();

            if (Node == null)
            {
                Node = Nodes.AddAndReturn(new WorkflowNode <T>());
            }
            Node.AddOperation(Workflow, Constraints);
            return(this);
        }
        private static JObject BuildTestResultJSONForWebRequest(this IWorkflowNode report)
        {
            var resObj = new JObject
            {
                { "Node Name", report.StepDescription },
                { "ActivityID", report.ActivityID },
                { "UniqueID", report.UniqueID },
                { "MockSelected", report.MockSelected }
            };

            return(resObj);
        }
예제 #6
0
 private static bool isCondition(IWorkflowNode node)
 {
     return(node is Condition);
 }
예제 #7
0
 public void Add(IWorkflowNode node)
 {
     NextNodes.Add(node);
 }
 private static bool IsNodeCovered(IWorkflowNode[] coveredNodes, IWorkflowNode node)
 {
     return(coveredNodes.Any(o => o.ActivityID == node.UniqueID && o.MockSelected is false));
 }
        public static void SetupNextNodeHTML(HtmlTextWriter writer, IWorkflowNode[] coveredNodes, IWorkflowNode node)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "next-node");

            if (IsNodeCovered(coveredNodes, node))
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Color, "green");
                writer.AddStyleAttribute(HtmlTextWriterStyle.FontSize, "12px");
                writer.RenderBeginTag(HtmlTextWriterTag.Li);
            }
            else
            {
                writer.AddStyleAttribute(HtmlTextWriterStyle.Color, "red");
                writer.AddStyleAttribute(HtmlTextWriterStyle.FontSize, "12px");
                writer.RenderBeginTag(HtmlTextWriterTag.Li);
            }

            writer.Write(node.StepDescription);
            writer.RenderEndTag();
        }
 private static bool IsNodeCovered(IWorkflowNode[] coveredNodes, IWorkflowNode node)
 {
     return(coveredNodes.Any(o => o.ActivityID == node.UniqueID));
 }