public async Task GetSqlStrTest() { using Sqless sqless = new Sqless(Global.AllowUnspecifiedConfig); SqlessInsertSqlBuilder producer = new SqlessInsertSqlBuilder(sqless, InsertRequest); var sqlStr = await producer.GetSqlStrTest(); Assert.AreEqual(sqlStr.Replace(" ", " ").Trim(), "INSERT INTO [User] ([Uid],[Name],[Password],[Phone]) VALUES (@Uid,@Name,@Password,@Phone)"); }
public async Task UpdateOwnerFieldSqlTest() { var insertRequest = new SqlessEditRequest() { Table = Tables.User, Fields = new List <SqlessEditField>() { new SqlessEditField() { Field = "Uid", Value = "2", Type = System.Data.DbType.String } } }; using Sqless insertSqless = new Sqless(Global.GetOwnerAccessConfig("1")); SqlessInsertSqlBuilder producer = new SqlessInsertSqlBuilder(insertSqless, insertRequest); var sqlStr = await producer.GetSqlStrTest(); Assert.AreEqual(insertRequest.Fields[0].Value, "1"); }