Update unit test

This commit is contained in:
sunkaixuan 2023-04-02 18:04:45 +08:00
parent 40bdcc3e2c
commit 2cbb6e727f

View File

@ -33,14 +33,16 @@ namespace OrmTest
}).ExecuteCommandWithOptLock(); }).ExecuteCommandWithOptLock();
if (data2 != 0) { throw new Exception("unit error"); }; if (data2 != 0) { throw new Exception("unit error"); };
var data3 = db.Updateable(new ULockEntity() var yy = new ULockEntity()
{ {
Id = id, Id = id,
Name = "newname2", Name = "newname2",
Ver = 0 Ver = 0
}) };
var data3 = db.Updateable(yy)
.UpdateColumns(z=>z.Name).ExecuteCommandWithOptLock(); .UpdateColumns(z=>z.Name).ExecuteCommandWithOptLock();
if (data3 != 0) { throw new Exception("unit error"); } if (data3 != 0) { throw new Exception("unit error"); }
if(yy.Ver!=0) { throw new Exception("unit error"); }
var ver = db.Queryable<ULockEntity>().InSingle(id); var ver = db.Queryable<ULockEntity>().InSingle(id);
var data4 = db.Updateable(new ULockEntity() var data4 = db.Updateable(new ULockEntity()
{ {