From 8c187165ae74c3ad7440aecf1c2c18612fa21e53 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 10 Oct 2022 09:00:10 +0800 Subject: [PATCH] Add unit test --- Src/Asp.Net/SqlServerTest/UnitTest/Models/TestModel.cs | 10 ++++++++++ Src/Asp.Net/SqlServerTest/UnitTest/UJson.cs | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/Models/TestModel.cs b/Src/Asp.Net/SqlServerTest/UnitTest/Models/TestModel.cs index f8254b47d..7116366e5 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/Models/TestModel.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/Models/TestModel.cs @@ -14,6 +14,16 @@ namespace SqlSugarSelect [SqlSugar.SugarColumn(ColumnDataType = "ntext", IsJson = true)] 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")] public class TestModel2 { diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UJson.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UJson.cs index 85b7f190c..841e44ad8 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UJson.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UJson.cs @@ -1,4 +1,5 @@ using SqlSugar; +using SqlSugarSelect; using System; using System.Collections.Generic; using System.Linq; @@ -85,6 +86,12 @@ namespace OrmTest { throw new Exception("unit test"); } + + var list13=db.Queryable().AS("UnitTestModel1").Select().ToList(); + if (list13.First().Ids.Count() == 0) + { + throw new Exception("unit test"); + } } } public class UnitJsonTestadsga1