public void GetContentLength_IfHeadersDoesNotContainContentLengthHeader_ReturnsNull() { // Arrange IHeaderDictionary headers = CreateStubHeaders(); IOwinRequest request = CreateStubRequest(headers); // Act int?length = OwinRequestExtensions.GetContentLength(request); // Assert Assert.False(length.HasValue); }
public void GetContentLength_IfContentLengthHeaderIsNegative_ReturnsNull() { // Arrange IHeaderDictionary headers = CreateStubHeaders("Content-Length", new string[] { "-1" }); IOwinRequest request = CreateStubRequest(headers); // Act int?length = OwinRequestExtensions.GetContentLength(request); // Assert Assert.False(length.HasValue); }
public void GetContentLength_IfHeadersIsNull_ReturnsNull() { // Arrange IOwinRequest request = CreateStubRequest(headers: null); Assert.Null(request.Headers); // Guard // Act int?length = OwinRequestExtensions.GetContentLength(request); // Assert Assert.False(length.HasValue); }