Exemplo n.º 1
0
        public void ValueIterator()
        {
            CombinedHttpHeaders headers = NewCombinedHttpHeaders();

            headers.Set(HeaderName, new List <ICharSequence> {
                (StringCharSequence)"\ta", (StringCharSequence)"   ", (StringCharSequence)"  b ", (StringCharSequence)"\t \t"
            });
            headers.Add(HeaderName, new List <ICharSequence> {
                (StringCharSequence)" c, d \t"
            });

            var list = new List <ICharSequence>(headers.ValueCharSequenceIterator(new AsciiString("foo")));

            Assert.Empty(list);
            AssertValueIterator(headers.ValueCharSequenceIterator(HeaderName));
        }
Exemplo n.º 2
0
        public void NonCombinableHeaderIterator()
        {
            CombinedHttpHeaders headers = NewCombinedHttpHeaders();

            headers.Add(HttpHeaderNames.SetCookie, "c");
            headers.Add(HttpHeaderNames.SetCookie, "b");
            headers.Add(HttpHeaderNames.SetCookie, "a");

            var strItr = headers.ValueCharSequenceIterator(HttpHeaderNames.SetCookie).ToList();

            Assert.Equal(3, strItr.Count);
            Assert.Equal("a", strItr[0]);
            Assert.Equal("b", strItr[1]);
            Assert.Equal("c", strItr[2]);
        }