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
5683ee45e0
commit
58ee2f8f1c
@ -33,6 +33,7 @@ namespace OrmTest
|
|||||||
}
|
}
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
Unitadfasda.Init();
|
||||||
Unita3affafa.Init();
|
Unita3affafa.Init();
|
||||||
UnitEnumTest.Init();
|
UnitEnumTest.Init();
|
||||||
Unitadf1yaadfa.Init();
|
Unitadf1yaadfa.Init();
|
||||||
|
@ -0,0 +1,53 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OrmTest
|
||||||
|
{
|
||||||
|
internal class Unitadfasda
|
||||||
|
{
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
var db = NewUnitTest.Db;
|
||||||
|
db.CodeFirst.InitTables<Tax_Base_EmpSerial>();
|
||||||
|
db.CurrentConnectionConfig.MoreSettings = new ConnMoreSettings() { IsCorrectErrorSqlParameterName = true };
|
||||||
|
var ent = new Tax_Base_EmpSerial { Serial = "202401", 工号 = "1001", 户籍所在地_详细地址 = "湖南长沙" };
|
||||||
|
var i = db.Updateable(ent).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Tax_Base_EmpSerial
|
||||||
|
/// </summary>
|
||||||
|
[Serializable]
|
||||||
|
[SugarTable("tax_base_empserial", "Tax_Base_EmpSerial", IsDisabledDelete = true)]
|
||||||
|
public partial class Tax_Base_EmpSerial
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///Serial
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "serial", ColumnDescription = "Serial", IsPrimaryKey = true, Length = 20, IsNullable = false)]
|
||||||
|
public string Serial { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///工号
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "工号", ColumnDescription = "工号", Length = 50, IsNullable = true)]
|
||||||
|
public string 工号 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///户籍所在地(详细地址)
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "户籍所在地(详细地址)", ColumnDescription = "户籍所在地(详细地址)", Length = 255, IsNullable = true)]
|
||||||
|
public string 户籍所在地_详细地址 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///户籍所在地(详细地址)
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "户籍所在地(省)", ColumnDescription = "户籍所在地(省)", Length = 255, IsNullable = true)]
|
||||||
|
public string 户籍所在地_省 { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -146,12 +146,7 @@ namespace OrmTest
|
|||||||
throw new Exception("unit error");
|
throw new Exception("unit error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Console.WriteLine("用例跑完");
|
|
||||||
|
|
||||||
Console.ReadKey();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user