コード例 #1
0
            public void AllowsForNullRequest()
            {
                RequestSignatureVerificationResultFailure actual = null;
                Action act = () => actual = new RequestSignatureVerificationResultFailure(_client, null, _failure);

                act.Should().NotThrow();
                actual.RequestForVerification.Should().BeNull();
            }
コード例 #2
0
            public void ReturnsFailureInstanceWithExpectedPropertyValues()
            {
                var actual = _sut.CreateForFailure(_failure);

                actual.Should().NotBeNull().And.BeAssignableTo <RequestSignatureVerificationResultFailure>();
                var expected = new RequestSignatureVerificationResultFailure(_client, _signature, _failure);

                actual.As <RequestSignatureVerificationResultFailure>().Should().BeEquivalentTo(expected);
            }
コード例 #3
0
 public RequestSignatureVerificationResultFailureTests()
 {
     _request = new HttpRequestForVerification {
         Method     = HttpMethod.Post,
         RequestUri = "https://unittest.com:9000".ToUri(),
         Signature  = (Signature)TestModels.Signature.Clone()
     };
     _client = new Client(
         _request.Signature.KeyId,
         "Unit test app",
         new HMACSignatureAlgorithm("s3cr3t", HashAlgorithmName.SHA256),
         TimeSpan.FromMinutes(1),
         TimeSpan.FromMinutes(1),
         RequestTargetEscaping.RFC3986);
     _failure = new InvalidSignatureStringSignatureVerificationFailure(
         "The verification failed",
         new InvalidOperationException("Epic fail"));
     _sut = new RequestSignatureVerificationResultFailure(_client, _request, _failure);
 }