コード例 #1
0
        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)");
        }
コード例 #2
0
ファイル: OwnerAuthTest.cs プロジェクト: hal-wang/Sqless
        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");
        }