mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Add unit test
This commit is contained in:
parent
506415f71a
commit
ed56b9e8f7
@ -1,4 +1,5 @@
|
|||||||
using System;
|
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;
|
||||||
@ -13,7 +14,14 @@ namespace OrmTest
|
|||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
var db = NewUnitTest.Db;
|
var db = NewUnitTest.Db;
|
||||||
|
db.CodeFirst.InitTables<Unitadadfafa>();
|
||||||
|
db.Updateable(new Unitadadfafa() {Id=11, Name = "a" }).ExecuteCommand();
|
||||||
|
var sqlobj=db.Updateable(new Unitadadfafa() { Id = 211, Name = "a" }).ToSqlString();
|
||||||
|
if (sqlobj != @"UPDATE [Unitadadfafa] SET
|
||||||
|
[Name]=N'a' WHERE [Id]=211")
|
||||||
|
{
|
||||||
|
throw new Exception("UnitSelectNASFDADSFA error");
|
||||||
|
}
|
||||||
db.CodeFirst.InitTables<ProductProcessUnit, ProcessUnit>();
|
db.CodeFirst.InitTables<ProductProcessUnit, ProcessUnit>();
|
||||||
db.DbMaintenance.TruncateTable<ProductProcessUnit, ProcessUnit>();
|
db.DbMaintenance.TruncateTable<ProductProcessUnit, ProcessUnit>();
|
||||||
db.Insertable(
|
db.Insertable(
|
||||||
@ -72,5 +80,12 @@ namespace OrmTest
|
|||||||
throw new Exception("unit error");
|
throw new Exception("unit error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class Unitadadfafa
|
||||||
|
{
|
||||||
|
[SqlSugar.SugarColumn(IsPrimaryKey =true,SqlParameterDbType =typeof(CommonPropertyConvert))]
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user