Update unit test

This commit is contained in:
sunkaixuna 2021-08-01 12:41:24 +08:00
parent eaf297edc0
commit 2d5f95c167

View File

@ -10,7 +10,7 @@ namespace OrmTest
public partial class NewUnitTest public partial class NewUnitTest
{ {
public static SqlSugarClient simpleDb => new SqlSugarClient(new ConnectionConfig() public static SqlSugarScope simpleDb => new SqlSugarScope(new ConnectionConfig()
{ {
DbType = DbType.SqlServer, DbType = DbType.SqlServer,
ConnectionString = Config.ConnectionString, ConnectionString = Config.ConnectionString,
@ -25,13 +25,12 @@ namespace OrmTest
} }
} }
}); });
public static SqlSugarClient ssDb => new SqlSugarClient(new ConnectionConfig() public static ConnectionConfig Config = new ConnectionConfig()
{ {
DbType = DbType.SqlServer, DbType = DbType.SqlServer,
ConnectionString = Config.ConnectionString, ConnectionString = "server=.;uid=sa;pwd=sasa;database=SQLSUGAR4XTEST",
InitKeyType = InitKeyType.Attribute, InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true, IsAutoCloseConnection = true,
IsShardSameThread = true,
AopEvents = new AopEvents AopEvents = new AopEvents
{ {
OnLogExecuting = (sql, p) => OnLogExecuting = (sql, p) =>
@ -40,8 +39,10 @@ namespace OrmTest
Console.WriteLine(string.Join(",", p?.Select(it => it.ParameterName + ":" + it.Value))); Console.WriteLine(string.Join(",", p?.Select(it => it.ParameterName + ":" + it.Value)));
} }
} }
}); };
public static SqlSugarClient singleDb = new SqlSugarClient(new ConnectionConfig()
public static SqlSugarScope ssDb => new SqlSugarScope(Config);
public static SqlSugarScope singleDb = new SqlSugarScope(new ConnectionConfig()
{ {
DbType = DbType.SqlServer, DbType = DbType.SqlServer,
ConnectionString = Config.ConnectionString, ConnectionString = Config.ConnectionString,
@ -56,13 +57,12 @@ namespace OrmTest
} }
} }
}); });
public static SqlSugarClient singleAndSsDb = new SqlSugarClient(new ConnectionConfig() public static SqlSugarScope singleAndSsDb = new SqlSugarScope(new ConnectionConfig()
{ {
DbType = DbType.SqlServer, DbType = DbType.SqlServer,
ConnectionString = Config.ConnectionString, ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute, InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true, IsAutoCloseConnection = true,
IsShardSameThread = true,
AopEvents = new AopEvents AopEvents = new AopEvents
{ {
OnLogExecuting = (sql, p) => OnLogExecuting = (sql, p) =>