public static void OpenCursorNoArguments() { var statement = new OpenStatement("c1"); var sql = statement.ToString(); var expected = "OPEN c1"; Assert.AreEqual(expected, sql); }
public void OpenSimple() { var statement = new OpenStatement("c1"); statement.Execute(Query); var cursor = Query.FindCursor("c1"); Assert.IsNotNull(cursor); Assert.AreEqual("c1", cursor.CursorInfo.CursorName); Assert.AreEqual(CursorStatus.Open, cursor.Status); }
public static void OpenCursorWithArguments() { var statement = new OpenStatement("c1", new SqlExpression[] { SqlExpression.Constant(45), SqlExpression.VariableReference("a") }); var sql = statement.ToString(); var expected = "OPEN c1(45, :a)"; Assert.AreEqual(expected, sql); }
protected virtual SqlStatement VisitOpen(OpenStatement statement) { return new OpenStatement(statement.CursorName, statement.Arguments); }
public void OpenWithNoArguments() { var statement = new OpenStatement("c1"); SerializeAndAssert(statement, (serialized, deserialized) => { Assert.IsNotNull(deserialized); Assert.AreEqual("c1", deserialized.CursorName); Assert.IsEmpty(deserialized.Arguments); }); }
protected virtual SqlStatement VisitOpen(OpenStatement statement) { return(new OpenStatement(statement.CursorName, statement.Arguments)); }