Skip to content

Commit

Permalink
Fix workflow and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sungaila committed Jul 24, 2024
1 parent 3e771cd commit 9410571
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Generate artifact attestation
uses: actions/attest-build-provenance@main
with:
subject-path: src/PDFtoImage/bin/${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }}/*.nupkg
subject-path: PDFtoZPL/bin/${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }}/*.nupkg
- name: Publish libraries
uses: actions/upload-artifact@main
with:
Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"sungaila_PDFtoImage" /o:"sungaila" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
.\.sonar\scanner\dotnet-sonarscanner begin /k:"sungaila_PDFtoZPL" /o:"sungaila" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
dotnet build PDFtoZPL.SonarCloud.slnf -c ${{ github.event_name != 'workflow_dispatch' && 'Debug' || inputs.build_configuration }}
dotnet-coverage collect "dotnet test PDFtoZPL.SonarCloud.slnf --verbosity detailed" -f xml -o "coverage.xml"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
4 changes: 3 additions & 1 deletion Tests/ApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ public void PdfByteArrayNullException()
Assert.ThrowsException<ArgumentNullException>(() => ConvertPdfPage((byte[])null!));

Check warning on line 37 in Tests/ApiTests.cs

View workflow job for this annotation

GitHub Actions / Build

'Conversion.ConvertPdfPage(byte[], string?, int, PdfOptions, ZplOptions)' is obsolete: 'This method is deprecated and will be removed in a future release. Use SaveJpeg with a System.Index instead.'
}

#if NET6_0_OR_GREATER
[TestMethod]
public void PageNumberException()
{
Assert.ThrowsException<ArgumentOutOfRangeException>(() => ConvertPdfPage(string.Empty, page: -1));
Assert.ThrowsException<ArgumentOutOfRangeException>(() => ConvertPdfPage(string.Empty, -1));
}
#endif

[TestMethod]
public void PdfAllStreamNullException()
Expand Down

0 comments on commit 9410571

Please sign in to comment.