mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Add unit test
This commit is contained in:
parent
22de65a1d6
commit
e1ad221ebe
@ -14,6 +14,13 @@ namespace OrmTest
|
|||||||
Db.DbMaintenance.DropTable("UnitCodeTest1");
|
Db.DbMaintenance.DropTable("UnitCodeTest1");
|
||||||
Db.CodeFirst.InitTables<UnitCodeTest1>();
|
Db.CodeFirst.InitTables<UnitCodeTest1>();
|
||||||
Db.CodeFirst.InitTables<UnitCodeTest111>();
|
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
|
public class UnitCodeTest1
|
||||||
{
|
{
|
||||||
|
@ -13,6 +13,13 @@ namespace OrmTest
|
|||||||
if (Db.DbMaintenance.IsAnyTable("UnitCodeTest1", false))
|
if (Db.DbMaintenance.IsAnyTable("UnitCodeTest1", false))
|
||||||
Db.DbMaintenance.DropTable("UnitCodeTest1");
|
Db.DbMaintenance.DropTable("UnitCodeTest1");
|
||||||
Db.CodeFirst.InitTables<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
|
public class UnitCodeTest1
|
||||||
{
|
{
|
||||||
|
@ -28,6 +28,13 @@ namespace OrmTest
|
|||||||
if (x[0].Length != 18 && x[0].Scale != 0) throw new Exception("unit test error");
|
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[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");
|
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
|
public class UnitByteArray1
|
||||||
|
Loading…
Reference in New Issue
Block a user