diff --git a/ComputeGuard.Tests/ComputeGuardianSelectionTests.cs b/ComputeGuard.Tests/ComputeGuardianSelectionTests.cs index 2b21121..7cd207f 100644 --- a/ComputeGuard.Tests/ComputeGuardianSelectionTests.cs +++ b/ComputeGuard.Tests/ComputeGuardianSelectionTests.cs @@ -185,6 +185,22 @@ public sealed class ComputeGuardianSelectionTests Assert.Same(cause, report.InnerException); } + [Fact] + public void ThePinComesBeforeEveryOtherReason() + { + var (guardian, _) = CreateGuardian(); + var software = Device(1L, isSoftware: true); + var small = Device(2L, capacity: 1000L); + guardian.Fail(software, Workload, ComputeFailure.DeviceLost, null); + guardian.Fail(small, Workload, ComputeFailure.DeviceLost, null); + + var softwareDecision = guardian.Select(software, Workload, PassingSelfTest); + var smallDecision = guardian.Select(small, Workload, PassingSelfTest); + + Assert.Equal(new ComputeDecision(ComputeRoute.Cpu, ComputeRouteReason.Pinned), softwareDecision); + Assert.Equal(new ComputeDecision(ComputeRoute.Cpu, ComputeRouteReason.Pinned), smallDecision); + } + [Fact] public void ConcurrentSelectionsRunTheSelfTestOnce() {