Skip to content

Commit 61affab

Browse files
authored
Release 24.2 (#84)
* Update github checkout version from v3 to v4 * Update packages * Update version to 24.2.0 * Add tests with Types
1 parent 0c95c73 commit 61affab

15 files changed

+62
-36
lines changed

.github/workflows/build-examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
- name: Setup latest version of dotnet
1616
uses: actions/setup-dotnet@v3
1717
- name: Build nuget with latest version

.github/workflows/check-badges.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515

1616
- name: Check badges in README.md
1717
run: ./scripts/check-badges.bash "README.md"

.github/workflows/dotnet-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
continue-on-error: true
2929

3030
steps:
31-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@v4
3232
- name: Setup latest version of dotnet
3333
uses: actions/setup-dotnet@v3
3434
- name: Build with latest version

.github/workflows/net-framework.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
continue-on-error: true
2727

2828
steps:
29-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@v4
3030

3131
- name: Setup MSBuild
3232
uses: microsoft/[email protected]

.github/workflows/pack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
- name: Build the Docker image
1616
run: docker build . --file Dockerfile

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Nuget](https://img.shields.io/nuget/v/Aspose.BarCode-Cloud)](https://www.nuget.org/packages/Aspose.BarCode-Cloud/)
77

88
- API version: 3.0
9-
- SDK version: 24.1.0
9+
- SDK version: 24.2.0
1010

1111
## Demo applications
1212

@@ -35,7 +35,7 @@ The complete source code is available in this repository folder. You can either
3535

3636
## Prerequisites
3737

38-
To use Aspose.BarCode Cloud SDK for .NET you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and Client Id at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/pricing).
38+
To use Aspose.BarCode Cloud SDK for .NET you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and Client Id at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/).
3939

4040
## Installation
4141

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<PackageReference Include="Moq" Version="4.20.70" />
1616
<PackageReference Include="NUnit" Version="3.14.0" />
1717
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
18-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
18+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
1919
<PackageReference Include="System.Net.Http" Version="4.3.4" />
2020
</ItemGroup>
2121
<ItemGroup>

Tests/BarcodeApiTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public void GetBarcodeRecognizeTest()
133133
{
134134
folder = folder,
135135
Preset = PresetType.HighPerformance.ToString(),
136-
Timeout = 30_000
136+
Types = new List<DecodeBarcodeType> { DecodeBarcodeType.QR, DecodeBarcodeType.Code128 }
137137
}
138138
);
139139

@@ -177,7 +177,7 @@ public void PostBarcodeRecognizeFromUrlOrContentTest()
177177
{
178178
ChecksumValidation = ChecksumValidation.Off.ToString(),
179179
Preset = PresetType.HighPerformance.ToString(),
180-
Timeout = 30_000
180+
Types = new List<DecodeBarcodeType> { DecodeBarcodeType.Code11 }
181181
}
182182
);
183183

@@ -284,7 +284,7 @@ public void PutBarcodeRecognizeFromBodyTest()
284284
readerParams: new ReaderParams
285285
{
286286
Preset = PresetType.HighPerformance,
287-
Timeout = 30_000
287+
Types = new List<DecodeBarcodeType> { DecodeBarcodeType.Code128 }
288288
}
289289
)
290290
{
@@ -402,7 +402,7 @@ public async Task GetBarcodeRecognizeAsyncTest()
402402
{
403403
folder = folder,
404404
Preset = PresetType.HighPerformance.ToString(),
405-
Timeout = 30_000
405+
Types = new List<DecodeBarcodeType> { DecodeBarcodeType.QR, DecodeBarcodeType.Code128 }
406406
}
407407
);
408408

@@ -435,7 +435,7 @@ public async Task PostBarcodeRecognizeFromUrlOrContentAsyncTest()
435435
{
436436
ChecksumValidation = ChecksumValidation.Off.ToString(),
437437
Preset = PresetType.HighPerformance.ToString(),
438-
Timeout = 30_000
438+
Types = new List<DecodeBarcodeType> { DecodeBarcodeType.Code11 },
439439
}
440440
);
441441

@@ -481,7 +481,7 @@ public async Task PostGenerateMultipleAsyncTest()
481481
// Assert
482482
Assert.IsTrue(response.Length > 0);
483483
using FileStream savedFileStream = File.Create(TestFilePath("Test_PostGenerateMultiple.png"));
484-
response.CopyTo(savedFileStream);
484+
await response.CopyToAsync(savedFileStream);
485485
}
486486

487487

@@ -539,7 +539,7 @@ public async Task PutBarcodeRecognizeFromBodyAsyncTest()
539539
readerParams: new ReaderParams
540540
{
541541
Preset = PresetType.HighPerformance,
542-
Timeout = 30_000
542+
Types = new List<DecodeBarcodeType> { DecodeBarcodeType.Code128 }
543543
}
544544
)
545545
{

Tests/GenerateAndThenRecognize.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Collections.Generic;
12
using System.IO;
23
using System.Linq;
34
using System.Threading.Tasks;
@@ -32,6 +33,13 @@ public void GenerateAndThenRecognizeTest()
3233
BarcodeResponseList recognized = _api.PostBarcodeRecognizeFromUrlOrContent(
3334
#pragma warning restore CS0618 // Type or member is obsolete
3435
new PostBarcodeRecognizeFromUrlOrContentRequest(generatedImage)
36+
{
37+
Preset = PresetType.HighPerformance.ToString(),
38+
Types = new List<DecodeBarcodeType>
39+
{
40+
DecodeBarcodeType.QR
41+
}
42+
}
3543
);
3644

3745
Assert.AreEqual(1, recognized.Barcodes.Count);
@@ -55,6 +63,13 @@ public async Task GenerateAndThenRecognizeAsyncTest()
5563

5664
BarcodeResponseList recognized = await _api.PostBarcodeRecognizeFromUrlOrContentAsync(
5765
new PostBarcodeRecognizeFromUrlOrContentRequest(generatedImage)
66+
{
67+
Preset = PresetType.HighPerformance.ToString(),
68+
Types = new List<DecodeBarcodeType>
69+
{
70+
DecodeBarcodeType.QR
71+
}
72+
}
5873
);
5974

6075
Assert.AreEqual(1, recognized.Barcodes.Count);

Tests/JWTRequestHandlerTests.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ public void TestTokenRefresh()
8585
jwtHandler.BeforeSend(request2, new MemoryStream());
8686

8787
Assert.Contains("Authorization", request2.Headers.Keys);
88-
var auth = request2.Headers["Authorization"];
88+
string auth = request2.Headers["Authorization"];
8989
Assert.Greater(auth.Length, "Bearer ".Length);
90-
var token = auth.Substring("Bearer ".Length);
90+
string token = auth.Substring("Bearer ".Length);
9191
AssertTokenIsValid(token);
9292
}
9393

@@ -111,7 +111,7 @@ public async Task TestTokenFetchedAsync()
111111
Assert.IsTrue(request.Headers.Contains("Authorization"));
112112
var auth = request.Headers.Authorization.ToString();
113113
Assert.Greater(auth.Length, "Bearer ".Length);
114-
var token = auth.Substring("Bearer ".Length);
114+
string token = auth.Substring("Bearer ".Length);
115115
AssertTokenIsValid(token);
116116
}
117117

@@ -125,7 +125,7 @@ public async Task TestTokenRefreshAsync()
125125
}
126126

127127
// arrange
128-
HttpResponseMessage response401 = new HttpResponseMessage(HttpStatusCode.Unauthorized);
128+
var response401 = new HttpResponseMessage(HttpStatusCode.Unauthorized);
129129

130130
var jwtHandler = new JwtRequestHandler(TestConfiguration);
131131

@@ -146,7 +146,7 @@ public async Task TestTokenRefreshAsync()
146146
Assert.IsTrue(request2.Headers.Contains("Authorization"));
147147
var auth = request2.Headers.Authorization.ToString();
148148
Assert.Greater(auth.Length, "Bearer ".Length);
149-
var token = auth.Substring("Bearer ".Length);
149+
string token = auth.Substring("Bearer ".Length);
150150
AssertTokenIsValid(token);
151151
}
152152

@@ -173,6 +173,5 @@ private static void AssertTokenIsValid(string token)
173173

174174
Assert.AreEqual("JWT", tokenHeader["typ"]?.ToString());
175175
}
176-
177176
}
178177
}

0 commit comments

Comments
 (0)