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

            headers.Set("foo", "bar");

            Assert.True(headers.TryGetValue("foo", out ISet <string> values), "foo key not found");
            Assert.Equal("bar", values.Single());
        }
コード例 #2
0
        public void SetValuesCorrectly()
        {
            var headers = new RestHeaders();

            headers.Set("foo", "bar", "bla");

            Assert.True(headers.TryGetValue("foo", out ISet <string> values), "foo key not found");
            Assert.True(values.Any(x => x == "bar"), "bar value not found");
            Assert.True(values.Any(x => x == "bla"), "bla value not found");
        }
コード例 #3
0
        public void SetValuesDoesOverwriteExistingValues()
        {
            var headers = new RestHeaders
            {
                { "foo", "bar" }
            };

            headers.Set("foo", "bla");

            Assert.True(headers.TryGetValue("foo", out ISet <string> values), "foo key not found");
            Assert.Equal("bla", values.Single());
        }
コード例 #4
0
        public void SetValueDoesOverwriteExistingValues()
        {
            var headers = new RestHeaders
            {
                { "foo", "bar" }
            };

            headers.Set("foo", "bla", "baz");

            Assert.True(headers.TryGetValue("foo", out ISet <string> values), "foo key not found");
            Assert.True(values.Any(x => x == "bla"), "bla value not found");
            Assert.True(values.Any(x => x == "baz"), "baz value not found");
        }