Add unit test

This commit is contained in:
sunkaixuan 2022-10-10 09:00:10 +08:00
parent 685b19f3df
commit 8c187165ae
2 changed files with 17 additions and 0 deletions

View File

@ -14,6 +14,16 @@ namespace SqlSugarSelect
[SqlSugar.SugarColumn(ColumnDataType = "ntext", IsJson = true)] [SqlSugar.SugarColumn(ColumnDataType = "ntext", IsJson = true)]
public Guid[] Ids { get; set; } public Guid[] Ids { get; set; }
} }
public class ViewTestModel1
{
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
public string Titlt { get; set; }
[SqlSugar.SugarColumn(ColumnDataType = "ntext", IsJson = true,IsIgnore =true)]
public Guid[] Ids { get; set; }
}
[SqlSugar.SugarTable("UnitTestModel2")] [SqlSugar.SugarTable("UnitTestModel2")]
public class TestModel2 public class TestModel2
{ {

View File

@ -1,4 +1,5 @@
using SqlSugar; using SqlSugar;
using SqlSugarSelect;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -85,6 +86,12 @@ namespace OrmTest
{ {
throw new Exception("unit test"); throw new Exception("unit test");
} }
var list13=db.Queryable<object>().AS("UnitTestModel1").Select<ViewTestModel1>().ToList();
if (list13.First().Ids.Count() == 0)
{
throw new Exception("unit test");
}
} }
} }
public class UnitJsonTestadsga1 public class UnitJsonTestadsga1