public void Equals_ValuesUseDifferentValues_ValuesAreEqualOrDifferentAccordingToRfc()
        {
            NameValueWithParametersHeaderValue nameValue1 = new NameValueWithParametersHeaderValue("text", "value");
            NameValueWithParametersHeaderValue nameValue2 = new NameValueWithParametersHeaderValue("text", "value");
            NameValueHeaderValue nameValue3 = new NameValueHeaderValue("text", "value");

            // NameValueWithParametersHeaderValue just calls methods of the base class. Just verify Parameters is used.
            Assert.True(nameValue1.Equals(nameValue2), "No parameters.");
            Assert.False(nameValue1.Equals(null), "Compare to null.");
            Assert.False(nameValue1.Equals(nameValue3), "Compare to base class instance.");

            nameValue1.Parameters.Add(new NameValueHeaderValue("param1", "value1"));
            Assert.False(nameValue1.Equals(nameValue2), "none vs. 1 parameter.");

            nameValue2.Parameters.Add(new NameValueHeaderValue("param1", "value1"));
            Assert.True(nameValue1.Equals(nameValue2), "1 parameter vs. 1 parameter.");
        }
        public void Parse_ValidValue_ReturnsNameValueWithParametersHeaderValue()
        {
            // This test verifies that Parse() correctly calls TryParse().
            HttpHeaderParser parser = GenericHeaderParser.MultipleValueNameValueWithParametersParser;
            int index = 2;

            NameValueWithParametersHeaderValue expected = new NameValueWithParametersHeaderValue("custom");
            expected.Parameters.Add(new NameValueHeaderValue("name", "value"));
            Assert.True(expected.Equals(parser.ParseValue("   custom ; name = value ", null, ref index)));
            Assert.Equal(25, index);
        }