mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 16:18:47 +08:00
Add unit test
This commit is contained in:
parent
fb3c95ee79
commit
9ead049ea6
@ -32,6 +32,24 @@ namespace OrmTest
|
|||||||
Ver = 0
|
Ver = 0
|
||||||
}).ExecuteCommandWithOptLock();
|
}).ExecuteCommandWithOptLock();
|
||||||
if (data2 != 0) { throw new Exception("unit error"); };
|
if (data2 != 0) { throw new Exception("unit error"); };
|
||||||
|
|
||||||
|
var data3 = db.Updateable(new ULockEntity()
|
||||||
|
{
|
||||||
|
Id = id,
|
||||||
|
Name = "newname2",
|
||||||
|
Ver = 0
|
||||||
|
})
|
||||||
|
.UpdateColumns(z=>z.Name).ExecuteCommandWithOptLock();
|
||||||
|
if (data3 != 0) { throw new Exception("unit error"); }
|
||||||
|
var ver = db.Queryable<ULockEntity>().InSingle(id);
|
||||||
|
var data4 = db.Updateable(new ULockEntity()
|
||||||
|
{
|
||||||
|
Id = id,
|
||||||
|
Name = "newname2",
|
||||||
|
Ver = ver.Ver
|
||||||
|
})
|
||||||
|
.UpdateColumns(z => z.Name).ExecuteCommandWithOptLock();
|
||||||
|
if (data4 != 0) { throw new Exception("unit error"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ULockEntity
|
public class ULockEntity
|
||||||
|
Loading…
Reference in New Issue
Block a user