public void Parse_ValidValue_ReturnsTransferCodingHeaderValue()
        {
            // This test verifies that Parse() correctly calls TryParse().
            TransferCodingHeaderParser parser = TransferCodingHeaderParser.MultipleValueParser;
            int index = 2;

            TransferCodingHeaderValue expected = new TransferCodingHeaderValue("custom");
            expected.Parameters.Add(new NameValueHeaderValue("name", "value"));
            Assert.True(expected.Equals(parser.ParseValue("   custom ; name = value ", null, ref index)));
            Assert.Equal(25, index);
        }
        public void Equals_UseTransferCodingWithAndWithoutParameters_EqualOrNotEqualNoExceptions()
        {
            TransferCodingHeaderValue transferCoding1 = new TransferCodingHeaderValue("custom");
            TransferCodingHeaderValue transferCoding2 = new TransferCodingHeaderValue("CUSTOM");
            TransferCodingHeaderValue transferCoding3 = new TransferCodingHeaderValue("custom");
            transferCoding3.Parameters.Add(new NameValueHeaderValue("name", "value"));
            TransferCodingHeaderValue transferCoding4 = new TransferCodingHeaderValue("custom");
            transferCoding4.Parameters.Add(new NameValueHeaderValue("NAME", "VALUE"));
            TransferCodingHeaderValue transferCoding5 = new TransferCodingHeaderValue("custom");
            transferCoding5.Parameters.Add(new NameValueHeaderValue("name", "\"value\""));
            TransferCodingHeaderValue transferCoding6 = new TransferCodingHeaderValue("custom");
            transferCoding6.Parameters.Add(new NameValueHeaderValue("name", "\"VALUE\""));
            TransferCodingHeaderValue transferCoding7 = new TransferCodingHeaderValue("custom");
            transferCoding7.Parameters.Add(new NameValueHeaderValue("name", "\"VALUE\""));
            transferCoding7.Parameters.Clear();

            Assert.False(transferCoding1.Equals(null), "Compare to <null>.");
            Assert.True(transferCoding1.Equals(transferCoding2), "Different casing.");
            Assert.False(transferCoding1.Equals(transferCoding3), "No params vs. custom param.");
            Assert.True(transferCoding3.Equals(transferCoding4), "Params have different casing.");
            Assert.False(transferCoding5.Equals(transferCoding6),
                "Param value are quoted strings with different casing.");
            Assert.True(transferCoding1.Equals(transferCoding7), "no vs. empty parameters collection.");
        }