System.Net.Http.Tests.HttpContentHeadersTest.ContentLocation_UseAddMethodWithInvalidValue_InvalidValueRecognized C# (CSharp) Method

ContentLocation_UseAddMethodWithInvalidValue_InvalidValueRecognized() private method

        public void ContentLocation_UseAddMethodWithInvalidValue_InvalidValueRecognized()
        {
            _headers.TryAddWithoutValidation("Content-Location", " http://example.com http://other");
            Assert.Null(_headers.GetParsedValues("Content-Location"));
            Assert.Equal(1, _headers.GetValues("Content-Location").Count());
            Assert.Equal(" http://example.com http://other", _headers.GetValues("Content-Location").First());

            _headers.Clear();
            _headers.TryAddWithoutValidation("Content-Location", "http://host /other");
            Assert.Null(_headers.GetParsedValues("Content-Location"));
            Assert.Equal(1, _headers.GetValues("Content-Location").Count());
            Assert.Equal("http://host /other", _headers.GetValues("Content-Location").First());
        }
HttpContentHeadersTest