public void op_FromString_stringEmpty()
        {
            var expected = new HttpHeaderCollection();
            var actual   = HttpHeaderCollection.FromString(string.Empty);

            Assert.Equal(expected, actual);
        }
        public void op_Equals_object()
        {
            var obj = new HttpHeaderCollection
            {
                new HttpHeader("name", "value")
            };

            Assert.True(HttpHeaderCollection.FromString("name: value").Equals(obj));
        }
        public void op_FromString_string_withLeadingWhiteSpace()
        {
            var expected = new HttpHeaderCollection
            {
                new HttpHeader("name", "value")
            };
            var actual = HttpHeaderCollection.FromString("name:         value");

            Assert.Equal(expected, actual);
        }
        public void op_Equals_object_whenMultiple()
        {
            var obj = new HttpHeaderCollection
            {
                new HttpHeader("name", "foo"),
                new HttpHeader("name", "bar")
            };

            Assert.True(HttpHeaderCollection.FromString("name: foo, bar").Equals(obj));
        }
        public void op_FromString_string_whenMultipleLines()
        {
            var value =
                "a" + Environment.NewLine +
                ' ' + "b" + Environment.NewLine +
                '\t' + "c";

            var expected = new HttpHeaderCollection
            {
                new HttpHeader("name", value)
            };
            var actual = HttpHeaderCollection.FromString("name: " + value);

            Assert.Equal(expected, actual);
        }
 public void op_FromString_stringNull()
 {
     Assert.Throws <ArgumentNullException>(() => HttpHeaderCollection.FromString(null));
 }
 public void op_Equals_objectString()
 {
     Assert.False(HttpHeaderCollection.FromString("name: value").Equals("name: value"));
 }