public void SrcField_SrcGraphFieldAndListOfObjects_ReturnsCorrectReference() { IdentifierExpression identifier = new IdentifierExpression("test", 0, 0); SrcGraphField input1 = new SrcGraphField(identifier, 0, 0); List <Object> list = new List <Object>(); Function expected = new Function(1); Graph graph = new Graph(null, null, expected, null); IInterpreterFunction parent = Substitute.For <IInterpreterFunction>(); parent.DispatchGraph(identifier, Arg.Any <List <object> >()).Returns(graph); FunctionHelper functionHelper = SetupHelper(parent); Function res = functionHelper.SrcField(input1, list); Assert.AreEqual(expected.Reference, res.Reference); }
public Function SrcField(SrcGraphField node, List <Object> parameters) { Graph graph = _interpreter.DispatchGraph(node.Children[0], parameters); return(graph.Src); }