Ejemplo n.º 1
0
        private void CheckValidParsedValue(string input, int startIndex, Uri expectedResult, int expectedIndex)
        {
            UriHeaderParser parser = UriHeaderParser.RelativeOrAbsoluteUriParser;

            object result = null;

            Assert.True(parser.TryParseValue(input, null, ref startIndex, out result),
                        string.Format("TryParse returned false: {0}", input));
            Assert.Equal(expectedIndex, startIndex);
            Assert.Equal(expectedResult, result);
        }
Ejemplo n.º 2
0
        private void CheckInvalidParsedValue(string input, int startIndex)
        {
            UriHeaderParser parser = UriHeaderParser.RelativeOrAbsoluteUriParser;

            object result   = null;
            int    newIndex = startIndex;

            Assert.False(parser.TryParseValue(input, null, ref newIndex, out result),
                         string.Format("TryParse returned true: {0}", input));
            Assert.Equal(null, result);
            Assert.Equal(startIndex, newIndex);
        }