public virtual void Visit(SqlUserFunctionCall node) { foreach (SqlExpression argument in node.Arguments) { VisitInternal(argument); } }
public void SqlUserFunctionCallReplacingTest() { SqlUserFunctionCall ufc = SqlDml.FunctionCall("Func1", 1, 2, 3); SqlUserFunctionCall ufcReplacing = SqlDml.FunctionCall("Func2", "string"); ufc.ReplaceWith(ufcReplacing); bool passed = false; try { ufc.ReplaceWith(1); } catch { passed = true; } Assert.IsTrue(passed); Assert.AreNotEqual(ufc, ufcReplacing); Assert.AreEqual(ufc.NodeType, ufcReplacing.NodeType); Assert.AreEqual(ufc.Name, ufcReplacing.Name); Assert.AreEqual(ufc.FunctionType, ufcReplacing.FunctionType); Assert.AreEqual(ufc.Arguments.Count, ufcReplacing.Arguments.Count); for (int i = 0, l = ufc.Arguments.Count; i < l; i++) { Assert.AreEqual(ufc.Arguments[i], ufcReplacing.Arguments[i]); } }
public void Visit(SqlUserFunctionCall node) { foreach (var argument in node.Arguments) { Visit(argument); } }