mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-25 01:14:33 +08:00
Add unit test
This commit is contained in:
parent
8f04739e20
commit
d435b21326
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
@ -40,8 +41,24 @@ namespace OrmTest
|
|||||||
db.DeleteNav(address).IncludeByNameString("Persons")
|
db.DeleteNav(address).IncludeByNameString("Persons")
|
||||||
.IncludeByNameString("City").ExecuteCommand();
|
.IncludeByNameString("City").ExecuteCommand();
|
||||||
|
|
||||||
|
db.CodeFirst.InitTables<UnitTesta>();
|
||||||
|
db.CurrentConnectionConfig.MoreSettings = new SqlSugar.ConnMoreSettings() { EnableCodeFirstUpdatePrecision = true };
|
||||||
|
db.CodeFirst.InitTables<UNITTESTA>();
|
||||||
|
var data= db.DbMaintenance.GetColumnInfosByTableName("UNITTESTA", false);
|
||||||
|
if (data.First().DecimalDigits != 6)
|
||||||
|
{
|
||||||
|
throw new Exception("unit error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class UnitTesta
|
||||||
|
{
|
||||||
|
[SqlSugar.SugarColumn(Length =18,DecimalDigits =4)]
|
||||||
|
public decimal xx { get; set; }
|
||||||
|
}
|
||||||
|
public class UNITTESTA
|
||||||
|
{
|
||||||
|
[SqlSugar.SugarColumn(Length = 18, DecimalDigits = 6)]
|
||||||
|
public decimal xx { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[SqlSugar.SugarTable("UnitPerson01x1")]
|
[SqlSugar.SugarTable("UnitPerson01x1")]
|
||||||
|
Loading…
Reference in New Issue
Block a user