public void AllowsForNullRequest() { RequestSignatureVerificationResultFailure actual = null; Action act = () => actual = new RequestSignatureVerificationResultFailure(_client, null, _failure); act.Should().NotThrow(); actual.RequestForVerification.Should().BeNull(); }
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); }
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); }