Exemple #1
0
        private void CheckInvalidParsedValue(string input, int startIndex)
        {
            ProductInfoHeaderParser parser = ProductInfoHeaderParser.MultipleValueParser;
            object result   = null;
            int    newIndex = startIndex;

            Assert.False(parser.TryParseValue(input, null, ref newIndex, out result),
                         string.Format("TryParse returned true. Input: '{0}'", input));
            Assert.Equal(null, result);
            Assert.Equal(startIndex, newIndex);
        }
Exemple #2
0
        private void CheckValidParsedValue(string input, int startIndex, ProductInfoHeaderValue expectedResult,
                                           int expectedIndex)
        {
            ProductInfoHeaderParser parser = ProductInfoHeaderParser.MultipleValueParser;
            object result = null;

            Assert.True(parser.TryParseValue(input, null, ref startIndex, out result),
                        string.Format("TryParse returned false. Input: '{0}'", input));
            Assert.Equal(expectedIndex, startIndex);
            Assert.Equal(expectedResult, result);
        }