Exemplo n.º 1
0
        public void CanAddHeaders()
        {
            var headers = new HttpHeadersAbstraction();

            headers.Add("Test", "Value");
            Assert.IsTrue(headers.Contains("Test"));
            Assert.AreEqual("Value", headers["Test"].First());
        }
Exemplo n.º 2
0
        public void CanClearHeaders()
        {
            var headers = new HttpHeadersAbstraction();

            headers.Add("Test", "Value");
            Assert.IsTrue(headers.Contains("Test"));

            headers.Clear();
            Assert.AreEqual(0, headers.Count());
        }
Exemplo n.º 3
0
        public void CanGetValuesHeaders()
        {
            var headers = new HttpHeadersAbstraction();
            var values  = new List <string>()
            {
                "value1", "value2"
            };

            headers.Add("Test", values);
            Assert.IsTrue(headers.Contains("Test"));
            Assert.AreEqual(values, headers.GetValues("Test"));
        }
Exemplo n.º 4
0
        public void CanAddRangeHeaders()
        {
            var headers = new HttpHeadersAbstraction();

            var rspMsg = new HttpResponseMessage();

            rspMsg.Headers.Add("Test", "Value");

            headers.AddRange(rspMsg.Headers);
            Assert.IsTrue(headers.Contains("Test"));
            Assert.AreEqual("Value", headers["Test"].First());
        }