Example #1
0
        public void ResultNodeVisitTest()
        {
            var node = new ResultNode();
            var visitor = Mock.Create<INodeVisitor>();
            Mock.Arrange(() => visitor.Visit(node)).MustBeCalled();

            node.AcceptVisitor(visitor);
        }
        private DestinationNode ToExpressionNode(DestinationFieldList destination)
        {
            var destinationNode = new DestinationNode();

            foreach (var field in destination.Fields)
            {

                if (field.ConnectorIn.Connection == null)
                    continue;

                if (field.ConnectorIn.Connection.Source == null)
                    continue;

                var resultNode = new ResultNode
                                     {
                                         FieldName = field.Name,
                                         Expression =
                                             ToExpressionNode(
                                                 field.ConnectorIn.Connection.Source.Connection.Source.Owner,
                                                 field.ConnectorIn.Connection.Source.Connection
                                             )
                                     };

                destinationNode.ResultNodes.Add(resultNode);
            }

            return destinationNode;
        }
Example #3
0
 public void ResultNodeCtorTest()
 {
     Assert.AreEqual(ExpressionNodeType.Result, new ResultNode().NodeType);
     var node = new ResultNode("Field", new ConstantNode(NodeDataType.String));
     Assert.AreEqual("Field", node.FieldName);
     Assert.AreEqual(NodeDataType.String, node.DataType);
     Assert.IsNotNull(node.Expression);
 }