示例#1
0
    public void CanBuildInputParameter()
    {
        var          s      = new EdgeSql();
        var          pval   = new KeyValuePair <string, object>("Key", "Heres the value");
        SqlParameter result = s.GetParameter(pval);

        Assert.AreEqual(result.Value, pval.Value);
    }
示例#2
0
    public void CanBuildInputOuputParameter()
    {
        var s     = new EdgeSql();
        var param = new Dictionary <string, object>();

        param.Add("Direction", "InputOutput");
        param.Add("Value", "Heres the value");
        var          pval   = new KeyValuePair <string, object>("Key", param);
        SqlParameter result = s.GetParameter(pval);

        Assert.AreEqual(result.Value, param["Value"]);
        Assert.AreEqual(ParameterDirection.InputOutput, result.Direction);
    }
示例#3
0
    public async Task CanRunQuery()
    {
        var s    = new EdgeSql();
        var args = new Dictionary <string, object>();

        args.Add("commandText", "select * from Albums where AlbumId = @Id");
        args.Add("commandType", null);
        args.Add("connectionString", "Server=.\\SQLEXPRESS;Database=musicstore;Integrated Security=SSPI");
        var param = new Dictionary <string, object>();

        param.Add("Id", 1);
        args.Add("commandParameters", param);
        var response = await s.Invoke(args);

        Assert.IsNotNull(response);
    }