public async Task WhenAVerificationTaskFails_ReturnsFirstFailure_DoesNotRunSubsequentTasks()
            {
                var firstFailure = SignatureVerificationFailure.HeaderMissing("Invalid");

                A.CallTo(() => _matchingAlgorithmVerificationTask.Verify(_signedRequest, _sanitizedSignature, _client))
                .Returns(firstFailure);

                var secondFailure = SignatureVerificationFailure.SignatureExpired("Invalid");

                A.CallTo(() => _createdHeaderGuardVerificationTask.Verify(_signedRequest, _sanitizedSignature, _client))
                .Returns(secondFailure);

                var actual = await _sut.VerifySignature(_signedRequest, _signature, _client);

                actual.Should().Be(firstFailure);
            }
Пример #2
0
 public CreateForFailure()
 {
     _failure = SignatureVerificationFailure.HeaderMissing("You didn't say the magic word.");
 }