Add unit test

This commit is contained in:
sunkaixuan 2022-06-25 14:41:30 +08:00
parent 22de65a1d6
commit e1ad221ebe
3 changed files with 21 additions and 0 deletions

View File

@ -14,6 +14,13 @@ namespace OrmTest
Db.DbMaintenance.DropTable("UnitCodeTest1");
Db.CodeFirst.InitTables<UnitCodeTest1>();
Db.CodeFirst.InitTables<UnitCodeTest111>();
Db.CodeFirst.InitTables<UnitIndextest>();
}
[SqlSugar.SugarIndex("UnitIndextestIndex", nameof(UnitIndextest.Table), SqlSugar.OrderByType.Asc)]
public class UnitIndextest
{
public string Table { get; set; }
public string Id { get; set; }
}
public class UnitCodeTest1
{

View File

@ -13,6 +13,13 @@ namespace OrmTest
if (Db.DbMaintenance.IsAnyTable("UnitCodeTest1", false))
Db.DbMaintenance.DropTable("UnitCodeTest1");
Db.CodeFirst.InitTables<UnitCodeTest1>();
Db.CodeFirst.InitTables<UnitIndextest>();
}
[SqlSugar.SugarIndex("UnitIndextestIndex", nameof(UnitIndextest.Table), SqlSugar.OrderByType.Asc)]
public class UnitIndextest
{
public string Table { get; set; }
public string Id { get; set; }
}
public class UnitCodeTest1
{

View File

@ -28,6 +28,13 @@ namespace OrmTest
if (x[0].Length != 18 && x[0].Scale != 0) throw new Exception("unit test error");
if (x[1].Length != 18 && x[1].Scale != 2) throw new Exception("unit test error");
if (x[2].Length != 0 && x[2].Scale != 0) throw new Exception("unit test error");
Db.CodeFirst.InitTables<UnitIndextest>();
}
[SqlSugar.SugarIndex("UnitIndextestIndex", nameof(UnitIndextest.Table), SqlSugar.OrderByType.Asc)]
public class UnitIndextest
{
public string Table { get; set; }
public string Id { get; set; }
}
public class UnitByteArray1