Skip to content

Commit cea77a8

Browse files
Split tests for .net and old .netframework (#117)
* Split tests for .net and old .netframework --------- Co-authored-by: Denis Averin <59285247+Denis-Averin@users.noreply.github.com>
1 parent acc7b5f commit cea77a8

9 files changed

Lines changed: 67 additions & 13 deletions

.github/workflows/net-framework.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,19 @@ jobs:
3939
- name: Setup VSTest
4040
uses: darenm/Setup-VSTest@v1.2
4141

42-
- name: Build the Solution
43-
run: msbuild -restore -p:Configuration=Release
42+
- name: Pack nuget
43+
run: |
44+
msbuild -restore -t:clean,rebuild,pack -p:Configuration=Release
45+
copy src\bin\Release\*.nupkg NetFrameworkTests
46+
47+
- name: Build test project
48+
run: msbuild NetFrameworkTests\Aspose.BarCode.Cloud.Sdk.NetFrameworkTests.csproj -restore -p:Configuration=Release
4449

4550
- name: Test with VSTest
4651
run: |
4752
$ErrorActionPreference = "Stop"
48-
VSTest.Console.exe /Framework:".NETFramework,Version=${{ matrix.net-version }}" /ResultsDirectory:Tests\Results /Logger:"trx;LogFileName=test.log" Tests\bin\Release\${{ matrix.framework }}\Aspose.BarCode.Cloud.Sdk.Tests.dll
49-
if( ([xml](Get-Content Tests\Results\test.log)).TestRun.ResultSummary.Counters.total -ne 25 ){ throw "Not all tests were explored or added new tests" }
53+
VSTest.Console.exe /Framework:".NETFramework,Version=${{ matrix.net-version }}" /ResultsDirectory:NetFrameworkTests\Results /Logger:"trx;LogFileName=test.log" NetFrameworkTests\bin\Release\${{ matrix.framework }}\Aspose.BarCode.Cloud.Sdk.NetFrameworkTests.dll
54+
if( ([xml](Get-Content NetFrameworkTests\Results\test.log)).TestRun.ResultSummary.Counters.total -ne 21 ){ throw "Not all tests were explored or added new tests" }
5055
5156
env:
5257
TEST_CONFIGURATION_JWT_TOKEN: ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ _ReSharper.*
44
bin
55
obj
66
.vs
7-
Tests/Configuration*.json
7+
Configuration.json
88
*.DotSettings
99
*.binlog
1010
snippets_test/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ init:
1111
format:
1212
dotnet restore ./Aspose.BarCode.Cloud.Sdk.sln
1313
dotnet format ./Aspose.BarCode.Cloud.Sdk.sln --no-restore
14-
dotnet format --include ./snippets/
14+
dotnet format --include ./snippets/ --include ./NetFrameworkTests/
1515
# Trim white space in comments
1616
find . -iname "*.cs" -exec sed -i -e 's_[[:space:]]*$$__' {} \;
1717

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
<PropertyGroup>
4+
<TargetFrameworks>net462;net480;net481</TargetFrameworks>
5+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
6+
<IsTestProject>true</IsTestProject>
7+
<LangVersion>8.0</LangVersion>
8+
</PropertyGroup>
9+
<ItemGroup>
10+
<Compile Remove="TestResults\**" />
11+
<EmbeddedResource Remove="TestResults\**" />
12+
<None Remove="TestResults\**" />
13+
</ItemGroup>
14+
<ItemGroup>
15+
<Compile Include="..\Tests\ApiExceptionTests.cs" Link="ApiExceptionTests.cs" />
16+
<Compile Include="..\Tests\ConfigurationTests.cs" Link="ConfigurationTests.cs" />
17+
<Compile Include="..\Tests\GenerateAndThenRecognize.cs" Link="GenerateAndThenRecognize.cs" />
18+
<Compile Include="..\Tests\GenerateTests.cs" Link="GenerateTests.cs" />
19+
<Compile Include="..\Tests\JwtAuthTests.cs" Link="JwtAuthTests.cs" />
20+
<Compile Include="..\Tests\RecognizeTests.cs" Link="RecognizeTests.cs" />
21+
<Compile Include="..\Tests\ScanTests.cs" Link="ScanTests.cs" />
22+
<Compile Include="..\Tests\TestsBase.cs" Link="TestsBase.cs" />
23+
</ItemGroup>
24+
<ItemGroup>
25+
<PackageReference Include="Moq" Version="4.20.70" />
26+
<PackageReference Include="NUnit" Version="3.14.0" />
27+
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
28+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
29+
<PackageReference Include="System.Net.Http" Version="4.3.4" />
30+
</ItemGroup>
31+
<ItemGroup>
32+
<PackageReference Include="Aspose.BarCode-Cloud" Version="25.11.0" />
33+
</ItemGroup>
34+
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"ClientId": "Client Id from https://dashboard.aspose.cloud/applications",
3+
"ClientSecret": "Client Secret from https://dashboard.aspose.cloud/applications"
4+
}

NetFrameworkTests/nuget.config

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<configuration>
2+
3+
<packageSources>
4+
<add key="local" value="." />
5+
</packageSources>
6+
7+
<packageSourceMapping>
8+
<packageSource key="local">
9+
<package pattern="Aspose.BarCode-Cloud" />
10+
</packageSource>
11+
<packageSource key="nuget.org">
12+
<package pattern="*" />
13+
</packageSource>
14+
</packageSourceMapping>
15+
16+
</configuration>
8.39 KB
Loading

Tests/Aspose.BarCode.Cloud.Sdk.Tests.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFrameworks>net462;net480;net481;net8.0;net9.0;net10.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
55
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
6-
<WarningsNotAsErrors>NU1510</WarningsNotAsErrors>
76
<IsTestProject>true</IsTestProject>
8-
<LangVersion>8.0</LangVersion>
97
</PropertyGroup>
108
<ItemGroup>
119
<Compile Remove="TestResults\**"/>
@@ -17,7 +15,6 @@
1715
<PackageReference Include="NUnit" Version="3.14.0"/>
1816
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0"/>
1917
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0"/>
20-
<PackageReference Include="System.Net.Http" Version="4.3.4"/>
2118
</ItemGroup>
2219
<ItemGroup>
2320
<ProjectReference Include="..\src\Aspose.BarCode.Cloud.Sdk.csproj"/>

Tests/Configuration.template.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
22
"ClientId": "Client Id from https://dashboard.aspose.cloud/applications",
3-
"ClientSecret": "Client Secret from https://dashboard.aspose.cloud/applications",
4-
"ApiBaseUrl": "https://api.aspose.cloud",
5-
"TokenUrl": "https://api.aspose.cloud/connect/token"
3+
"ClientSecret": "Client Secret from https://dashboard.aspose.cloud/applications"
64
}

0 commit comments

Comments
 (0)