public void WhenAlgorithmDoesNotAllowInclusionOfExpiresHeader_ThrowsHttpMessageSigningException(string algorithmName) { var sut = new ExpiresHeaderAppender(algorithmName, _timeOfComposing, _expires); Action act = () => sut.BuildStringToAppend(HeaderName.PredefinedHeaderNames.Expires); act.Should().Throw <HttpMessageSigningException>(); }
public void WhenExpiresHasNoValue_ReturnsEmptyString() { var sut = new ExpiresHeaderAppender(_timeOfComposing, null); var actual = sut.BuildStringToAppend(HeaderName.PredefinedHeaderNames.Expires); actual.Should().Be(string.Empty); }
public void WhenTimeOfComposingHasNoValue_ReturnsEmptyString() { var sut = new ExpiresHeaderAppender(null, TimeSpan.FromMinutes(10)); var actual = sut.BuildStringToAppend(HeaderName.PredefinedHeaderNames.Expires); actual.Should().Be(string.Empty); }
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); }
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); }