mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Add unit test
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
using System;
|
using SqlSugar;
|
||||||
|
using SqlSugar.DbConvert;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -88,10 +90,26 @@ namespace OrmTest
|
|||||||
db.Fastest<UnitTable001>().BulkUpdate(new List<UnitTable001>() {
|
db.Fastest<UnitTable001>().BulkUpdate(new List<UnitTable001>() {
|
||||||
new UnitTable001() { Id=1, table="a"}
|
new UnitTable001() { Id=1, table="a"}
|
||||||
});
|
});
|
||||||
|
db.CodeFirst.InitTables<UnitBulkCopyaaa>();
|
||||||
|
db.DbMaintenance.TruncateTable<UnitBulkCopyaaa>();
|
||||||
|
db.Fastest<UnitBulkCopyaaa>().BulkCopy(new List<UnitBulkCopyaaa>()
|
||||||
|
{
|
||||||
|
new UnitBulkCopyaaa(){ a=DbType.GaussDB }
|
||||||
|
});
|
||||||
|
var value=db.Ado.GetString("select a from UnitBulkCopyaaa");
|
||||||
|
if (value != DbType.GaussDB.ToString())
|
||||||
|
{
|
||||||
|
throw new Exception("unit error");
|
||||||
|
}
|
||||||
Console.WriteLine("用例跑完");
|
Console.WriteLine("用例跑完");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public class UnitBulkCopyaaa
|
||||||
|
{
|
||||||
|
[SqlSugar.SugarColumn(ColumnDataType ="varchar(10)",SqlParameterDbType = typeof(EnumToStringConvert))]
|
||||||
|
public DbType a { get; set; }
|
||||||
|
}
|
||||||
public class UnitTestoffset11
|
public class UnitTestoffset11
|
||||||
{
|
{
|
||||||
[SqlSugar.SugarColumn(IsNullable = true)]
|
[SqlSugar.SugarColumn(IsNullable = true)]
|
||||||
|
Reference in New Issue
Block a user