Пример #1
0
        public void ParseInvalidSeparator()
        {
            var t_Rule = new SeparatorRule();

            var t_Expression = t_Rule.Match(CreateState(new Token(TokenType.Literal, "foo")));

            t_Expression
            .HasError()
            .Should()
            .BeTrue();
        }
Пример #2
0
        public void ParseSpecificSeparator()
        {
            var t_Rule = new SeparatorRule(".");

            var t_Expression = t_Rule.Match(CreateState(new Token(TokenType.Separator, ".")));

            t_Expression
            .HasError()
            .Should()
            .BeFalse();

            t_Expression.Value.Expressions.First()
            .Should()
            .BeOfType <SeparatorExpression>();

            ((SeparatorExpression)t_Expression.Value.Expressions.First())
            .Separator
            .Text
            .Should()
            .Be(".");
        }