更新Tests项目
parent
f055c08fa1
commit
0750abf8c7
|
|
@ -52,7 +52,7 @@
|
|||
<PackageReference Include="Microsoft.Graph.Core" Version="1.23.0" />
|
||||
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.10" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ using System.Reflection;
|
|||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
using Xunit;
|
||||
using Microsoft.Extensions.PlatformAbstractions;
|
||||
|
||||
namespace New_College.Tests
|
||||
{
|
||||
|
|
@ -31,7 +32,7 @@ namespace New_College.Tests
|
|||
[Fact]
|
||||
public void DI_Connet_Test()
|
||||
{
|
||||
var basePath = Microsoft.DotNet.PlatformAbstractions.ApplicationEnvironment.ApplicationBasePath;
|
||||
var basePath = PlatformServices.Default.Application.ApplicationBasePath;
|
||||
|
||||
IServiceCollection services = new ServiceCollection();
|
||||
services.AddAutoMapper(typeof(Startup));
|
||||
|
|
@ -43,7 +44,7 @@ namespace New_College.Tests
|
|||
ConnectionString = GetMainConnectionDb().Connection,//必填, 数据库连接字符串
|
||||
DbType = (SqlSugar.DbType)GetMainConnectionDb().DbType,//必填, 数据库类型
|
||||
IsAutoCloseConnection = true,//默认false, 时候知道关闭数据库连接, 设置为true无需使用using或者Close操作
|
||||
IsShardSameThread = true,//共享线程
|
||||
// sh = true,//共享线程
|
||||
InitKeyType = SqlSugar.InitKeyType.SystemTable//默认SystemTable, 字段信息读取, 如:该属性是不是主键,标识列等等信息
|
||||
});
|
||||
});
|
||||
|
|
@ -108,7 +109,7 @@ namespace New_College.Tests
|
|||
|
||||
public IContainer DICollections()
|
||||
{
|
||||
var basePath = Microsoft.DotNet.PlatformAbstractions.ApplicationEnvironment.ApplicationBasePath;
|
||||
var basePath = PlatformServices.Default.Application.ApplicationBasePath;
|
||||
|
||||
IServiceCollection services = new ServiceCollection();
|
||||
services.AddAutoMapper(typeof(Startup));
|
||||
|
|
@ -156,7 +157,7 @@ namespace New_College.Tests
|
|||
ConnectionString = GetMainConnectionDb().Connection,//必填, 数据库连接字符串
|
||||
DbType = (SqlSugar.DbType)GetMainConnectionDb().DbType,//必填, 数据库类型
|
||||
IsAutoCloseConnection = true,//默认false, 时候知道关闭数据库连接, 设置为true无需使用using或者Close操作
|
||||
IsShardSameThread = true,//共享线程
|
||||
// IsShardSameThread = true,//共享线程
|
||||
InitKeyType = SqlSugar.InitKeyType.SystemTable//默认SystemTable, 字段信息读取, 如:该属性是不是主键,标识列等等信息
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
|
@ -18,9 +18,10 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Moq" Version="4.13.1" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
|
||||
<PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
|
||||
<PackageReference Include="Moq" Version="4.20.70" />
|
||||
<PackageReference Include="xunit" Version="2.7.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
|
|
|||
Loading…
Reference in New Issue