mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Update unit
This commit is contained in:
parent
2d41e1ed35
commit
e029494ba5
@ -31,7 +31,8 @@ namespace OrmTest
|
|||||||
}
|
}
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
UCustom01.Init();
|
||||||
|
UCustom011.Init();
|
||||||
UBulkCopy.Init();
|
UBulkCopy.Init();
|
||||||
Bulk();
|
Bulk();
|
||||||
Insert();
|
Insert();
|
||||||
|
@ -13,16 +13,16 @@ namespace OrmTest
|
|||||||
{
|
{
|
||||||
var db = NewUnitTest.Db;
|
var db = NewUnitTest.Db;
|
||||||
db.Queryable<Order>().Where(it => (it.CreateTime - SqlFunc.GetDate()).TotalDays > 1).ToList();
|
db.Queryable<Order>().Where(it => (it.CreateTime - SqlFunc.GetDate()).TotalDays > 1).ToList();
|
||||||
var x1=db.Queryable<Order>().Select(it => (DateTime.Now - SqlFunc.GetDate().AddYears(-1)).TotalDays).ToList();
|
var x1=db.Queryable<Order>().Select(it => (SqlFunc.GetDate() - SqlFunc.GetDate().AddYears(-1)).TotalDays).ToList();
|
||||||
var x2 = db.Queryable<Order>().Select(it => (DateTime.Now - SqlFunc.GetDate().AddDays(-1)).TotalHours).ToList();
|
var x2 = db.Queryable<Order>().Select(it => (SqlFunc.GetDate() - SqlFunc.GetDate().AddDays(-1)).TotalHours).ToList();
|
||||||
var x3 = db.Queryable<Order>().Select(it => (DateTime.Now - SqlFunc.GetDate().AddHours(-1)).TotalMinutes).ToList();
|
var x3 = db.Queryable<Order>().Select(it => (SqlFunc.GetDate() - SqlFunc.GetDate().AddHours(-1)).TotalMinutes).ToList();
|
||||||
var x4 = db.Queryable<Order>().Select(it => (DateTime.Now - SqlFunc.GetDate().AddMinutes(-1)).TotalSeconds).ToList();
|
var x4 = db.Queryable<Order>().Select(it => (SqlFunc.GetDate() - SqlFunc.GetDate().AddMinutes(-1)).TotalSeconds).ToList();
|
||||||
if (x1.Any())
|
if (x1.Any())
|
||||||
{
|
{
|
||||||
Check.Exception(x1.First()!=365, "unit error . UCustom011");
|
Check.Exception(x1.First()!=365, "unit error . UCustom011");
|
||||||
Check.Exception(x2.First() != 24, "unit error . UCustom011");
|
Check.Exception(x2.First() != 24, "unit error . UCustom011");
|
||||||
Check.Exception(x3.First() != 60, "unit error . UCustom011");
|
Check.Exception(x3.First()<=59|| x3.First() >=61, "unit error . UCustom011");
|
||||||
Check.Exception(x4.First() != 60, "unit error . UCustom011");
|
Check.Exception(x4.First() <= 59 || x4.First() >= 61, "unit error . UCustom011");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user