Add unit test

This commit is contained in:
sunkaixuan 2023-10-17 11:17:18 +08:00
parent 7d20f06833
commit 4ee7cdf6a2

View File

@ -1,4 +1,5 @@
using System;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
@ -41,13 +42,36 @@ namespace OrmTest
{
throw new Exception("unit error");
}
for (int i = 0; i < 1000; i++)
for (int i = 0; i < 1; i++)
{
db.Fastest<UnitaafdsTest>()
.BulkMerge(list);
}
db.CodeFirst.InitTables<TableA>();
db.Insertable(new TableA() { key1 = Guid.NewGuid() + "" })
.ExecuteCommand();
db.Insertable(new TableA() { key1 = Guid.NewGuid() + "" })
.ExecuteCommand();
var datas = db.Queryable<TableA>().ToList();
db.Fastest<TableA>().PageSize(10000).BulkMerge(datas);
}
}
public class TableA
{
[SugarColumn(IsPrimaryKey = true)]
public string key1 { get; set; } = "a";
[SugarColumn(IsPrimaryKey = true)]
public string key2 { get; set; } = "b";
[SugarColumn(IsPrimaryKey = true)]
public string key3 { get; set; } = "c";
public string str1 { get; set; } = "c";
public string str2 { get; set; } = "c";
public DateTime? date1 { get; set; } = DateTime.Now;
public DateTime? date2 { get; set; } = DateTime.Now;
public decimal? num1 { get; set; } = 0;
public decimal? num2 { get; set; } = 0;
}
public class UnitaafdsTest
{
[SqlSugar.SugarColumn(IsPrimaryKey = true)]