Exemplo n.º 1
0
        /// <summary>
        /// Reads the next character off of the input stream and advances the current position.
        /// Throws an exception if the character is not a letter.
        /// </summary>
        /// <returns></returns>
        public SourceChar ReadLetter()
        {
            var peek = this.Peek();

            if (!(StringValidator.IsUpperAlpha(peek.Value) || StringValidator.IsLowerAlpha(peek.Value)))
            {
                throw new UnexpectedCharacterException(peek);
            }
            return(this.Read());
        }
Exemplo n.º 2
0
            public static void IsLowerAlphaTest(char value, bool expectedResult)
            {
                var result = StringValidator.IsLowerAlpha(value);

                Assert.AreEqual(expectedResult, result);
            }