<commit_before>// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
using Microsoft.Extensions.Primitives;
using Xunit;

namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
{
    public class HttpRequestHeadersTests
    {
        [Fact]
        public void InitialDictionaryIsEmpty()
        {
            IDictionary<string, StringValues> headers = new HttpRequestHeaders();

            Assert.Equal(0, headers.Count);
            Assert.False(headers.IsReadOnly);
        }

        [Fact]
        public void SettingUnknownHeadersWorks()
        {
            IDictionary<string, StringValues> headers = new HttpRequestHeaders();

            headers["custom"] = new[] { "value" };

            Assert.Equal(1, headers["custom"].Count);
            Assert.Equal("value", headers["custom"][0]);
        }

        [Fact]
        public void SettingKnownHeadersWorks()
        {
            IDictionary<string, StringValues> headers = new HttpRequestHeaders();

            headers["host"] = new[] { "value" };
            headers["content-length"] = new[] { "0" };

            Assert.Equal(1, headers["host"].Count);
            Assert.Equal(1, headers["content-length"].Count);
            Assert.Equal("value", headers["host"][0]);
            Assert.Equal("0", headers["content-length"][0]);<commit_msg>Minor test code changes to resolve xUnit2013 build warning<commit_after>// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
using Microsoft.Extensions.Primitives;
using Xunit;

namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
{
    public class HttpRequestHeadersTests
    {
        [Fact]
        public void InitialDictionaryIsEmpty()
        {
            IDictionary<string, StringValues> headers = new HttpRequestHeaders();

            Assert.Equal(0, headers.Count);
            Assert.False(headers.IsReadOnly);
        }

        [Fact]
        public void SettingUnknownHeadersWorks()
        {
            IDictionary<string, StringValues> headers = new HttpRequestHeaders();

            headers["custom"] = new[] { "value" };

            var header = Assert.Single(headers["custom"]);
            Assert.Equal("value", header);
        }

        [Fact]
        public void SettingKnownHeadersWorks()
        {
            IDictionary<string, StringValues> headers = new HttpRequestHeaders();

            headers["host"] = new[] { "value" };
            headers["content-length"] = new[] { "0" };

            var host = Assert.Single(headers["host"]);
            var contentLength = Assert.Single(headers["content-length"]);
            Assert.Equal("value", host);
            Assert.Equal("0", contentLength);
{'fraction_non_alphanumeric': 0.11811023622047244, 'fraction_numerical': 0.0060569351907934586, 'mean_word_length': 2.7322033898305085, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1784700', 'n_tokens_mistral': 852, 'n_tokens_neox': 842, 'n_words': 202}