コード例 #1
0
            public void WhenAlgorithmDoesNotAllowInclusionOfExpiresHeader_ThrowsHttpMessageSigningException(string algorithmName)
            {
                var    sut = new ExpiresHeaderAppender(algorithmName, _timeOfComposing, _expires);
                Action act = () => sut.BuildStringToAppend(HeaderName.PredefinedHeaderNames.Expires);

                act.Should().Throw <HttpMessageSigningException>();
            }
コード例 #2
0
            public void WhenExpiresHasNoValue_ReturnsEmptyString()
            {
                var sut = new ExpiresHeaderAppender(_timeOfComposing, null);

                var actual = sut.BuildStringToAppend(HeaderName.PredefinedHeaderNames.Expires);

                actual.Should().Be(string.Empty);
            }
コード例 #3
0
            public void WhenTimeOfComposingHasNoValue_ReturnsEmptyString()
            {
                var sut = new ExpiresHeaderAppender(null, TimeSpan.FromMinutes(10));

                var actual = sut.BuildStringToAppend(HeaderName.PredefinedHeaderNames.Expires);

                actual.Should().Be(string.Empty);
            }
コード例 #4
0
            public void ReturnsExpectedString()
            {
                var sut = new ExpiresHeaderAppender("hs2019", _timeOfComposing, _expires);

                var actual = sut.BuildStringToAppend(HeaderName.PredefinedHeaderNames.Expires);

                var expected = "\n(expires): 1582540214";

                actual.Should().Be(expected);
            }
コード例 #5
0
            public void WhenExpiresHasValue_ReturnsExpectedString()
            {
                var expires = TimeSpan.FromMinutes(10);
                var sut     = new ExpiresHeaderAppender(_timeOfComposing, expires);

                var actual = sut.BuildStringToAppend(HeaderName.PredefinedHeaderNames.Expires);

                var expected = "\n(expires): 1582540214";

                actual.Should().Be(expected);
            }