private void CheckInvalidParsedValue(string source, int index) { TransferCodingHeaderParser parser = TransferCodingHeaderParser.MultipleValueParser; object result = null; int newIndex = index; Assert.False(parser.TryParseValue(source, null, ref newIndex, out result), string.Format("TryParse returned true. Input: '{0}', Index: {1}", source, index)); Assert.Equal(null, result); Assert.Equal(index, newIndex); }
private void CheckValidParsedValue(string input, int index, TransferCodingHeaderValue expectedResult, int expectedIndex) { TransferCodingHeaderParser parser = TransferCodingHeaderParser.MultipleValueParser; object result = null; Assert.True(parser.TryParseValue(input, null, ref index, out result), string.Format("TryParse returned false. Input: '{0}', Index: {1}", input, index)); Assert.Equal(expectedIndex, index); Assert.Equal(result, expectedResult); }