mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 18:34:55 +08:00
Update Unit Test
This commit is contained in:
@@ -124,6 +124,23 @@ new List<SugarParameter>() {
|
||||
(@Name) ;SELECT SCOPE_IDENTITY();", new List<SugarParameter>() {
|
||||
new SugarParameter("@Name","张三")
|
||||
}, t11.Key, t11.Value, "Insert t11 error");
|
||||
|
||||
|
||||
var t12 = db.Insertable<Student>(new { Name = "a" }).ToSql();
|
||||
base.Check(@"INSERT INTO [STudent]
|
||||
([Name])
|
||||
VALUES
|
||||
(@Name) ;SELECT SCOPE_IDENTITY();", new List<SugarParameter>() {
|
||||
new SugarParameter("@Name","a")
|
||||
}, t12.Key, t12.Value, "Insert t12 error");
|
||||
|
||||
var t13 = db.Insertable<Student>(new Dictionary<string, object>() { {"id",0 },{ "name","2"} }).ToSql();
|
||||
base.Check(@"INSERT INTO [STudent]
|
||||
([Name])
|
||||
VALUES
|
||||
(@Name) ;SELECT SCOPE_IDENTITY();", new List<SugarParameter>() {
|
||||
new SugarParameter("@Name","2")
|
||||
}, t13.Key, t13.Value, "Insert t13 error");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,6 +144,21 @@ namespace OrmTest.UnitTest
|
||||
"Update 12 error"
|
||||
);
|
||||
|
||||
|
||||
|
||||
var t13 = db.Updateable<Student>(new { Name = "a", id=1 }).ToSql();
|
||||
base.Check(@"UPDATE [STudent] SET
|
||||
[Name]=@Name WHERE [Id]=@Id", new List<SugarParameter>() {
|
||||
new SugarParameter("@Name","a"),
|
||||
new SugarParameter("@ID",1)
|
||||
}, t13.Key, t13.Value, "Insert t13 error");
|
||||
|
||||
var t14 = db.Updateable<Student>(new Dictionary<string, object>() { { "id", 0 }, { "name", "2" } }).ToSql();
|
||||
base.Check(@"UPDATE [STudent] SET
|
||||
[Name]=@Name WHERE [Id]=@Id", new List<SugarParameter>() {
|
||||
new SugarParameter("@Name", "2"),
|
||||
new SugarParameter("@ID", 0)
|
||||
}, t14.Key, t14.Value, "Insert t14 error");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user