System.Net.Http.Tests.HttpHeaderValueCollectionTest.Count_AddMultipleValuesThenQueryCount_ReturnsValueCountWithSpecialValues C# (CSharp) Method

Count_AddMultipleValuesThenQueryCount_ReturnsValueCountWithSpecialValues() private method

        public void Count_AddMultipleValuesThenQueryCount_ReturnsValueCountWithSpecialValues()
        {
            MockHeaders headers = new MockHeaders(knownHeader, new MockHeaderParser(typeof(string)));
            HttpHeaderValueCollection<string> collection = new HttpHeaderValueCollection<string>(knownHeader, headers,
                "special");

            Assert.Equal(0, collection.Count);

            collection.Add("value1");
            headers.Add(knownHeader, "special");
            Assert.Equal(2, collection.Count);

            headers.Add(knownHeader, "special");
            headers.Add(knownHeader, "value2");
            headers.Add(knownHeader, "special");
            Assert.Equal(5, collection.Count);
        }
HttpHeaderValueCollectionTest