From 0bca3aa774eb4dc1e1c288dc37ba79ae52f771c6 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 2 Dec 2023 02:18:28 +0800 Subject: [PATCH] Add uses case test --- .../UnitTest/UinitCustomConvert.cs | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/UinitCustomConvert.cs b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/UinitCustomConvert.cs index b9cdb5aa8..d83394f4f 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/UinitCustomConvert.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/UinitCustomConvert.cs @@ -53,6 +53,17 @@ namespace OrmTest Demo1(db); Demo2(db); Demo3(db); + var afterMsgContent = "1"; + var msgContent="2"; + var updateable =db.Updateable() + + .SetColumns(it => it.CONTENT == afterMsgContent) + .Where(it => it.CONTENT==msgContent) + .ToSql(); + if (updateable.Value.First().ParameterName == updateable.Value.Last().ParameterName) + { + throw new Exception("unit error"); + } } private static void Demo1(SqlSugarClient db) @@ -86,6 +97,26 @@ namespace OrmTest } } } + [SugarTable("TEST_CONTENT")] + public class TestContent + { + /// + /// ID + /// + [SugarColumn(ColumnName = "ID", ColumnDescription = "Id", OracleSequenceName = "TEST_CONTENT_ID_SEQ", IsIdentity = true, IsPrimaryKey = true)] + public long Id { get; set; } + + /// + /// 内容 + /// + [SugarColumn(ColumnName = "CONTENT", ColumnDescription = "CONTENT", ColumnDataType = "nvarchar2", SqlParameterDbType = typeof(Nvarchar2PropertyConvert))] + public string CONTENT { get; set; } = string.Empty; + + + [SugarColumn(ColumnName = "EditId", ColumnDescription = "EditId")] + public long EditId { get; set; } = 218; + + } public class Uinitadfa22122X {