From d5a0618e2643ac54472b78708d1d19147a49453e Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 18 May 2019 10:11:50 +0800 Subject: [PATCH] Update Demo --- .../SqlServerTest/SqlServerTest.csproj | 1 + .../SqlServerTest/UnitTest/ObjectsValidate.cs | 19 +++++++++++++++++++ Src/Asp.Net/SqlServerTest/UnitTest/UJson.cs | 2 ++ 3 files changed, 22 insertions(+) create mode 100644 Src/Asp.Net/SqlServerTest/UnitTest/ObjectsValidate.cs diff --git a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj index 721c29b62..47a8ef269 100644 --- a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj +++ b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj @@ -140,6 +140,7 @@ + diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/ObjectsValidate.cs b/Src/Asp.Net/SqlServerTest/UnitTest/ObjectsValidate.cs new file mode 100644 index 000000000..e847b2093 --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/UnitTest/ObjectsValidate.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrmTest +{ + public class ObjectsValidate + { + public static void Check(object a ,object b,object name) + { + if (a?.ToString() != b?.ToString()) + { + new Exception(name+" error"); + } + } + } +} diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UJson.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UJson.cs index 12b98d904..e5ee1982a 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UJson.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UJson.cs @@ -15,7 +15,9 @@ namespace OrmTest Db.DbMaintenance.TruncateTable(); Db.Insertable(new JsonTest() { Order = new Order { Id = 1, Name = "order1" } }).ExecuteCommand(); var list = Db.Queryable().ToList(); + ObjectsValidate.Check("order1", list.First().Order.Name, "Json"); Db.Updateable(new JsonTest() { Id = 1, Order = new Order { Id = 2, Name = "order2" } }).ExecuteCommand(); + ObjectsValidate.Check("order2", list.First().Order.Name, "Json"); var list2 = Db.Queryable().ToList(); } }