Esempio n. 1
0
    public void BuildSql()
    {
        var            expected       = "id=?id";
        SqlText        sqlText        = new SqlText(expected, "?");
        RequestContext requestContext = new RequestContext();

        sqlText.BuildSql(requestContext);
        var actual = requestContext.SqlBuilder.ToString();

        Assert.Equal(expected, actual);
    }
Esempio n. 2
0
    public void BuildSqlWithInAndSemicolon()
    {
        SqlText        sqlText        = new SqlText("in ?Ids;", "?");
        RequestContext requestContext = new RequestContext()
        {
            Request = new
            {
                Ids = new[] { 1, 2 }
            }
        };

        requestContext.SetupParameters();
        sqlText.BuildSql(requestContext);
        var actual = requestContext.SqlBuilder.ToString();

        Assert.Equal("In (?Ids_0,?Ids_1);", actual);
    }