Add unit test

This commit is contained in:
sunkaixuan 2023-09-23 18:44:09 +08:00
parent 72551d6050
commit 14d80ec9e8
5 changed files with 268 additions and 0 deletions

View File

@ -114,6 +114,7 @@
<Compile Include="UnitTest\ULock.cs" />
<Compile Include="UnitTest\Unit001.cs" />
<Compile Include="UnitTest\Unitadfaafsd.cs" />
<Compile Include="UnitTest\Unitadfafafasd.cs" />
<Compile Include="UnitTest\UnitByteArray.cs" />
<Compile Include="UnitTest\UnitPgSplit.cs" />
<Compile Include="UnitTest\UJsonFunc.cs" />

View File

@ -31,6 +31,7 @@ namespace OrmTest
}
public static void Init()
{
Unitadfafafasd.Init();
UintOneToOneDto.Init();
Unitadfaafsd.Init();
CrossDatabase02.Init();

View File

@ -0,0 +1,133 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
internal class Unitadfafafasd
{
public static void Init()
{
var db = NewUnitTest.Db;
db.CodeFirst.InitTables<event_handle_task>();
event_handle_task model = new event_handle_task();
db.CodeFirst.InitTables<event_handle_task>();
var p = model.data_source_type;
var xxx2 = db.Updateable<event_handle_task>().SetColumns(u => new event_handle_task
{
data_source_type = p ?? 20,
})
.Where(c => c.id == 454206551670915072)
.ToSql();
var xx= UtilMethods.GetNativeSql(xxx2.Key, xxx2.Value.ToArray());
}
/// <summary>
///event_handle_task
/// </summary>
[Serializable]
public partial class event_handle_task
{
#region Model
private long _id;
private int _event_type;
private int? _data_source_type;
private string _data_source_id;
private string _data_source_content;
private int? _opt_count = 0;
private int _serial_flag = 0;
private DateTime? _create_date = DateTime.Now;
private DateTime? _update_date = DateTime.Now;
/// <summary>
///
/// </summary>
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
public long id
{
set { _id = value; }
get { return _id; }
}
/// <summary>
///
/// </summary>
public int event_type
{
set { _event_type = value; }
get { return _event_type; }
}
/// <summary>
///
/// </summary>
public int? data_source_type
{
set { _data_source_type = value; }
get { return _data_source_type; }
}
/// <summary>
///
/// </summary>
public string data_source_id
{
set { _data_source_id = value; }
get { return _data_source_id; }
}
/// <summary>
///
/// </summary>
public string data_source_content
{
set { _data_source_content = value; }
get { return _data_source_content; }
}
/// <summary>
///
/// </summary>
public int? opt_count
{
set { _opt_count = value; }
get { return _opt_count; }
}
/// <summary>
///
/// </summary>
public int serial_flag
{
set { _serial_flag = value; }
get { return _serial_flag; }
}
/// <summary>
///
/// </summary>
public DateTime? create_date
{
set { _create_date = value; }
get { return _create_date; }
}
/// <summary>
///
/// </summary>
public DateTime? update_date
{
set { _update_date = value; }
get { return _update_date; }
}
#endregion Model
}
}
}

View File

@ -31,6 +31,7 @@ namespace OrmTest
}
public static void Init()
{
Unitadfafafasd.Init();
UnitSubToList.Init();
Unit001.Init();
Bulk();

View File

@ -0,0 +1,132 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
internal class Unitadfafafasd
{
public static void Init()
{
var db = NewUnitTest.Db;
db.CodeFirst.InitTables<event_handle_task>();
event_handle_task model = new event_handle_task();
db.CodeFirst.InitTables<event_handle_task>();
var p = model.data_source_type;
var xxx2 = db.Updateable<event_handle_task>().SetColumns(u => new event_handle_task
{
data_source_type = p ?? 20,
})
.Where(c => c.id == 454206551670915072)
.ExecuteCommand();
}
/// <summary>
///event_handle_task
/// </summary>
[Serializable]
public partial class event_handle_task
{
#region Model
private long _id;
private int _event_type;
private int? _data_source_type;
private string _data_source_id;
private string _data_source_content;
private int? _opt_count = 0;
private int _serial_flag = 0;
private DateTime? _create_date = DateTime.Now;
private DateTime? _update_date = DateTime.Now;
/// <summary>
///
/// </summary>
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
public long id
{
set { _id = value; }
get { return _id; }
}
/// <summary>
///
/// </summary>
public int event_type
{
set { _event_type = value; }
get { return _event_type; }
}
/// <summary>
///
/// </summary>
public int? data_source_type
{
set { _data_source_type = value; }
get { return _data_source_type; }
}
/// <summary>
///
/// </summary>
public string data_source_id
{
set { _data_source_id = value; }
get { return _data_source_id; }
}
/// <summary>
///
/// </summary>
public string data_source_content
{
set { _data_source_content = value; }
get { return _data_source_content; }
}
/// <summary>
///
/// </summary>
public int? opt_count
{
set { _opt_count = value; }
get { return _opt_count; }
}
/// <summary>
///
/// </summary>
public int serial_flag
{
set { _serial_flag = value; }
get { return _serial_flag; }
}
/// <summary>
///
/// </summary>
public DateTime? create_date
{
set { _create_date = value; }
get { return _create_date; }
}
/// <summary>
///
/// </summary>
public DateTime? update_date
{
set { _update_date = value; }
get { return _update_date; }
}
#endregion Model
}
}
}