예제 #1
0
        public void TryMatch_NonMatchingInputsAreGiven_ResultIsNonMatching(string input)
        {
            var matcher = new KeywordMatcher();
            var result  = matcher.TryMatch(input);

            Assert.False(result.IsMatching);
        }
예제 #2
0
        public void TryMatch_MatchingInputsAreGiven_ResultPropertiesAreValid(string input, string expectedTokenValue, int expectedNextIndex)
        {
            var matcher = new KeywordMatcher();
            var result  = matcher.TryMatch(input);

            Assert.True(result.IsMatching);
            Assert.AreEqual(TokenType.Keyword, result.Token.TokenType);
            Assert.AreEqual(expectedTokenValue, result.Token.Value);
            Assert.AreEqual(expectedNextIndex, result.NextIndex);
        }