-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add ScanBarcode endpoint * Version 24.4.0 * Drop outdated 'netcoreapp3.1' support * Update examples
- Loading branch information
1 parent
9aed71f
commit f3663e2
Showing
132 changed files
with
429 additions
and
2,518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>netcoreapp3.1;net462;net480;net481;net6.0;net7.0;net8.0</TargetFrameworks> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<IsTestProject>true</IsTestProject> | ||
<LangVersion>8.0</LangVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Remove="TestResults\**" /> | ||
<EmbeddedResource Remove="TestResults\**" /> | ||
<None Remove="TestResults\**" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Moq" Version="4.20.70" /> | ||
<PackageReference Include="NUnit" Version="3.14.0" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" /> | ||
<PackageReference Include="System.Net.Http" Version="4.3.4" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\src\Aspose.BarCode.Cloud.Sdk.csproj" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<TargetFrameworks>net462;net480;net481;net6.0;net7.0;net8.0</TargetFrameworks> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<IsTestProject>true</IsTestProject> | ||
<LangVersion>8.0</LangVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Remove="TestResults\**"/> | ||
<EmbeddedResource Remove="TestResults\**"/> | ||
<None Remove="TestResults\**"/> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Moq" Version="4.20.70"/> | ||
<PackageReference Include="NUnit" Version="3.14.0"/> | ||
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0"/> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0"/> | ||
<PackageReference Include="System.Net.Http" Version="4.3.4"/> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\src\Aspose.BarCode.Cloud.Sdk.csproj"/> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"ClientId": "Client Id from https://dashboard.aspose.cloud/applications", | ||
"ClientSecret": "Client Secret from https://dashboard.aspose.cloud/applications", | ||
"ApiBaseUrl": "https://api.aspose.cloud", | ||
"TokenUrl":"https://api.aspose.cloud/connect/token" | ||
"ClientId": "Client Id from https://dashboard.aspose.cloud/applications", | ||
"ClientSecret": "Client Secret from https://dashboard.aspose.cloud/applications", | ||
"ApiBaseUrl": "https://api.aspose.cloud", | ||
"TokenUrl": "https://api.aspose.cloud/connect/token" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
using Aspose.BarCode.Cloud.Sdk.Api; | ||
using Aspose.BarCode.Cloud.Sdk.Interfaces; | ||
using Aspose.BarCode.Cloud.Sdk.Model; | ||
using Aspose.BarCode.Cloud.Sdk.Model.Requests; | ||
using NUnit.Framework; | ||
|
||
namespace Aspose.BarCode.Cloud.Sdk.Tests | ||
{ | ||
[TestFixture] | ||
public class ScanTests : TestsBase | ||
{ | ||
private IBarcodeApi _api; | ||
|
||
[SetUp] | ||
public void Init() | ||
{ | ||
_api = new BarcodeApi(TestConfiguration); | ||
} | ||
|
||
|
||
[Test] | ||
public async Task ScanBarcodeAsyncTest() | ||
{ | ||
// Arrange | ||
using Stream image = GetTestImage("Test_PostGenerateMultiple.png"); | ||
|
||
// Act | ||
BarcodeResponseList response = await _api.ScanBarcodeAsync( | ||
new ScanBarcodeRequest(image) | ||
{ | ||
decodeTypes = new List<DecodeBarcodeType> { DecodeBarcodeType.Code128, DecodeBarcodeType.QR } | ||
} | ||
); | ||
|
||
// Assert | ||
Assert.AreEqual(2, response.Barcodes.Count); | ||
Assert.AreEqual(DecodeBarcodeType.QR.ToString(), response.Barcodes[0].Type); | ||
Assert.AreEqual("Hello world!", response.Barcodes[0].BarcodeValue); | ||
} | ||
|
||
|
||
[Test] | ||
public void ScanBarcodeAsyncTimeoutTest() | ||
{ | ||
// Arrange | ||
using Stream image = GetTestImage("Test_PostGenerateMultiple.png"); | ||
|
||
// Act | ||
var apiException = Assert.ThrowsAsync<ApiException>(async () => | ||
{ | ||
await _api.ScanBarcodeAsync( | ||
new ScanBarcodeRequest(image) | ||
{ | ||
timeout = 1 | ||
} | ||
); | ||
}); | ||
|
||
// Assert | ||
Assert.IsNotNull(apiException); | ||
Assert.AreEqual(408, apiException.ErrorCode); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.