コード例 #1
0
            public void WhenAddIsUsedAndNameIsTheSameThenCountDoesNotIncrease()
            {
                var headers = new HttpConnectHeaders();

                headers.Add("name-1", "value-1");
                headers.Add("name-1", "value-1");
                headers.Add("name-1", "value-1");
                headers.Add("name-1", "value-1");
                headers.Add("name-1", "value-1");

                headers.Should().HaveCount(1);
            }
コード例 #2
0
            public void WhenAddIsUsedThenCountIncreases()
            {
                var headers = new HttpConnectHeaders();

                headers.Add("name-1", "value-1");
                headers.Add("name-2", "value-2");
                headers.Add("name-3", "value-3");
                headers.Add("name-4", "value-4");
                headers.Add("name-5", "value-5");

                headers.Should().HaveCount(5);
            }
コード例 #3
0
            public void ReturnsFalseWhenHeaderCannotBeFound()
            {
                var headers = new HttpConnectHeaders();

                headers.Add("x-header", "value");

                headers.TryGetValue("UNKNOWN", out string _).Should().BeFalse();
            }
コード例 #4
0
            public void ReturnsTrueWhenHeaderCanBeFound()
            {
                var headers = new HttpConnectHeaders();

                headers.Add("x-header", "value");

                headers.TryGetValue("x-header", out string _).Should().BeTrue();
            }
コード例 #5
0
            public void ReturnsNullInOutParameterWhenHeaderCannotBeFound()
            {
                var headers = new HttpConnectHeaders();

                headers.Add("x-header", "my-value");

                headers.TryGetValue("UNKNOWN", out string value);

                value.Should().BeNull();
            }