Add unit test

This commit is contained in:
sunkaixuan 2022-10-21 12:26:06 +08:00
parent fb3c95ee79
commit 9ead049ea6

View File

@ -32,6 +32,24 @@ namespace OrmTest
Ver = 0
}).ExecuteCommandWithOptLock();
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