public void IsMatch_IdentifierAndIdentifierPattern_True()
        {
            const string text = "  a1vd ";

            var lexicalRule = MockRepository.GenerateMock<ILexicalRule>();
            lexicalRule.Expect(r => r.Pattern).Return(IdentifierExpression);
            var compiledLexicalRule = new CompiledLexicalRule(lexicalRule);

            Assert.That(compiledLexicalRule.IsMatch(text), Is.True);
            lexicalRule.VerifyAllExpectations();
        }
        public void IsWrongRule_WrongPattern_True()
        {
            const string pattern = @"^(?<e>[\s\S]*)$";
            const string text = "  a1vd bu ";

            var lexicalRule = MockRepository.GenerateMock<ILexicalRule>();
            lexicalRule.Expect(r => r.Pattern).Return(pattern);
            var compiledLexicalRule = new CompiledLexicalRule(lexicalRule);

            Assert.That(compiledLexicalRule.IsMatch(text), Is.True);
            Assert.That(compiledLexicalRule.IsWrongRule(text), Is.True);
            lexicalRule.VerifyAllExpectations();
        }