From cb07a73b0658c264072763147d2c9a447938cf12 Mon Sep 17 00:00:00 2001 From: Ben Hutchison Date: Thu, 8 Jun 2023 02:49:22 -0700 Subject: [PATCH] SpiDevice.Create only throws a PlatformNotSupportedException on Windows, not on Linux --- .github/workflows/dotnet.yml | 6 +++--- Tests/DryerMonitorTest.cs | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index fd7fc78..ec4901a 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -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 diff --git a/Tests/DryerMonitorTest.cs b/Tests/DryerMonitorTest.cs index b691abe..22ff91a 100644 --- a/Tests/DryerMonitorTest.cs +++ b/Tests/DryerMonitorTest.cs @@ -108,7 +108,11 @@ public class DryerMonitorTest: IDisposable { [Fact] public void publicConstructor() { Action thrower = () => new DryerMonitor(NullLogger.Instance, pagerDutyManager, config); - thrower.Should().Throw(); + if (Environment.OSVersion.Platform == PlatformID.Win32NT) { + thrower.Should().Throw(); + } else { + thrower.Should().NotThrow(); + } } public void Dispose() {