CopyTo() public method

Copies the elements of the T:Stumps.IHttpHeaders collection to another T:Stumps.IHttpHeaders.
is null.
public CopyTo ( IHttpHeaders httpHeaders ) : void
httpHeaders IHttpHeaders The target .
return void
Exemplo n.º 1
0
        public void CopyTo_WithValidHeaders_CopiesAllHeaders()
        {
            var source = new HttpHeaders();
            var target = new HttpHeaders();

            source["abc"] = "123";
            source["def"] = "456";

            source.CopyTo(target);

            Assert.AreEqual(source.Count, target.Count);
        }
Exemplo n.º 2
0
        public void CopyTo_WithValidHeaders_CopiesAllHeaders()
        {
            var source = new HttpHeaders();
            var target = new HttpHeaders();

            source["abc"] = "123";
            source["def"] = "456";

            source.CopyTo(target);

            Assert.AreEqual(source.Count, target.Count);
        }
Exemplo n.º 3
0
        public void CopyTo_WithValidHeaders_UpdatesExistingHeaders()
        {
            var source = new HttpHeaders();
            var target = new HttpHeaders();

            source["abc"] = "123";
            source["def"] = "456";
            target["abc"] = "999";

            source.CopyTo(target);

            Assert.AreEqual(source.Count, target.Count);
            Assert.AreEqual(source["abc"], target["abc"]);
        }
Exemplo n.º 4
0
        public void CopyTo_WithValidHeaders_UpdatesExistingHeaders()
        {
            var source = new HttpHeaders();
            var target = new HttpHeaders();

            source["abc"] = "123";
            source["def"] = "456";
            target["abc"] = "999";

            source.CopyTo(target);

            Assert.AreEqual(source.Count, target.Count);
            Assert.AreEqual(source["abc"], target["abc"]);
        }