Skip to content

Commit

Permalink
SpiDevice.Create only throws a PlatformNotSupportedException on Windo…
Browse files Browse the repository at this point in the history
…ws, not on Linux
  • Loading branch information
Aldaviva committed Jun 8, 2023
1 parent 4180726 commit cb07a73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:
domain: ${{ github.repository_owner }}

- name: Restore
run: dotnet restore --locked-mode --verbosity normal
run: dotnet restore --locked-mode

- name: Build
run: dotnet build ${{ env.ProjectName }} --no-restore --configuration Release --runtime ${{ env.TargetPlatform }} --no-self-contained --verbosity normal
run: dotnet build ${{ env.ProjectName }} --no-restore --configuration Release --runtime ${{ env.TargetPlatform }} --no-self-contained

- name: Test
shell: bash
run: |
dotnet test --verbosity normal --configuration Release --collect:"XPlat Code Coverage" --settings Tests/Tests.runsettings --logger "trx;LogFileName=TestResults.xml"
dotnet test --configuration Release --collect:"XPlat Code Coverage" --settings Tests/Tests.runsettings --logger "trx;LogFileName=TestResults.xml"
echo "TEST_EXIT_CODE=$?" >> $GITHUB_ENV
cp Tests/TestResults/*/coverage.info Tests/TestResults
exit 0
Expand Down
6 changes: 5 additions & 1 deletion Tests/DryerMonitorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ public class DryerMonitorTest: IDisposable {
[Fact]
public void publicConstructor() {
Action thrower = () => new DryerMonitor(NullLogger<DryerMonitor>.Instance, pagerDutyManager, config);
thrower.Should().Throw<PlatformNotSupportedException>();
if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
thrower.Should().Throw<PlatformNotSupportedException>();
} else {
thrower.Should().NotThrow<PlatformNotSupportedException>();
}
}

public void Dispose() {
Expand Down

0 comments on commit cb07a73

Please sign in to comment.