예제 #1
0
        public void GetContentLength_IfHeadersDoesNotContainContentLengthHeader_ReturnsNull()
        {
            // Arrange
            IHeaderDictionary headers = CreateStubHeaders();
            IOwinRequest      request = CreateStubRequest(headers);

            // Act
            int?length = OwinRequestExtensions.GetContentLength(request);

            // Assert
            Assert.False(length.HasValue);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }