feat: Add .NET Standard 2.0 target

This commit is contained in:
Valters Melnalksnis
2022-11-09 21:57:31 +02:00
parent 19440e6d3b
commit 43764cc3f3
13 changed files with 76 additions and 37 deletions
+6
View File
@@ -2,9 +2,15 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))"/>
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<IsTrimmable>false</IsTrimmable>
<EnableTrimAnalyzer>false</EnableTrimAnalyzer>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<NoWarn>NETSDK1138</NoWarn>
<CoverletOutputFormat>opencover</CoverletOutputFormat>
<CoverletOutput>$(MSBuildThisFileDirectory)TestResults/$(AssemblyName)/$(TargetFramework)/</CoverletOutput>
</PropertyGroup>
<ItemGroup>
@@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\source\VMelnalksnis.NordigenDotNet\VMelnalksnis.NordigenDotNet.csproj"/>
<ProjectReference Include="..\..\source\VMelnalksnis.NordigenDotNet.DependencyInjection\VMelnalksnis.NordigenDotNet.DependencyInjection.csproj"/>
@@ -3,7 +3,6 @@
// See LICENSE file in the project root for full license information.
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
@@ -13,6 +12,10 @@ using VMelnalksnis.NordigenDotNet.Agreements;
using Xunit.Abstractions;
#if NET6_0_OR_GREATER
using System.Net;
#endif
using static VMelnalksnis.NordigenDotNet.Tests.Integration.ServiceProviderFixture;
namespace VMelnalksnis.NordigenDotNet.Tests.Integration.Agreements;
@@ -57,8 +60,12 @@ public sealed class AgreementClientTests : IClassFixture<ServiceProviderFixture>
.Awaiting(() => _nordigenClient.Agreements.Put(createdAgreement.Id, acceptance))
.Should()
.ThrowExactlyAsync<HttpRequestException>())
#if NET6_0_OR_GREATER
.Which.StatusCode.Should()
.Be(HttpStatusCode.Forbidden, "test company cannot create agreements");
#else
.Which.Should().NotBeNull("test company cannot create agreements");
#endif
await _nordigenClient.Agreements.Delete(createdAgreement.Id);
@@ -66,7 +73,11 @@ public sealed class AgreementClientTests : IClassFixture<ServiceProviderFixture>
.Awaiting(() => _nordigenClient.Agreements.Get(createdAgreement.Id))
.Should()
.ThrowExactlyAsync<HttpRequestException>())
#if NET6_0_OR_GREATER
.Which.StatusCode.Should()
.Be(HttpStatusCode.NotFound);
#else
.Which.Should().NotBeNull("test company cannot create agreements");
#endif
}
}
@@ -87,8 +87,11 @@ public sealed class RequisitionsClientTests : IClassFixture<ServiceProviderFixtu
.Awaiting(() => _nordigenClient.Requisitions.Get(requisition.Id))
.Should()
.ThrowExactlyAsync<HttpRequestException>())
.Which.StatusCode
.Should()
#if NET6_0_OR_GREATER
.Which.StatusCode.Should()
.Be(HttpStatusCode.NotFound);
#else
.Which.Should().NotBeNull("test company cannot create agreements");
#endif
}
}
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<UserSecretsId>471f5b3c-5334-4315-8d06-7bcfb17af644</UserSecretsId>
</PropertyGroup>
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>