mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 21:53:35 +08:00
Add user test cases
This commit is contained in:
parent
06db3277be
commit
ea2fd3ccd9
@ -29,7 +29,39 @@ namespace OrmTest
|
||||
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>();
|
||||
Db.CodeFirst.InitTables<UnitDropColumnTest>();
|
||||
Db.CodeFirst.InitTables<UNITDROPCOLUMNTEST>();
|
||||
var column= Db.DbMaintenance.GetColumnInfosByTableName("UNITDROPCOLUMNTEST", false);
|
||||
if (column.Count != 3)
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
|
||||
var db = Db;
|
||||
db.CurrentConnectionConfig.MoreSettings = new ConnMoreSettings()
|
||||
{
|
||||
SqliteCodeFirstEnableDropColumn=true
|
||||
};
|
||||
db.CodeFirst.InitTables<UNITDROPCOLUMNTEST>();
|
||||
var column2 = db.DbMaintenance.GetColumnInfosByTableName("UNITDROPCOLUMNTEST", false);
|
||||
if (column2.Count != 2)
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
}
|
||||
|
||||
public class UnitDropColumnTest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Name2 { get; set; }
|
||||
}
|
||||
public class UNITDROPCOLUMNTEST
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
[SqlSugar.SugarIndex("UnitIndextestIndex", nameof(UnitIndextest.Table), SqlSugar.OrderByType.Asc)]
|
||||
public class UnitIndextest
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user