コード例 #1
0
        public void LineParser_TooManyImplies_ReturnsInvalidSyntax()
        {
            string           line        = "\ttherefore p implies z";
            SyntacticElement parseResult = LineParser.Parse(line);

            Assert.AreEqual(typeof(InvalidSyntacticElement), parseResult.GetType());
        }
コード例 #2
0
        public void LineParser_InvalidRHS_ReturnsInvalidSyntax()
        {
            string           line        = "\tproposition ( p and q ) ifandonlyif z r";
            SyntacticElement parseResult = LineParser.Parse(line);

            Assert.AreEqual(typeof(InvalidSyntacticElement), parseResult.GetType());
        }
コード例 #3
0
        public void LineParser_TooManyIfAndOnlyIfs_ReturnsInvalidSyntax()
        {
            string           line        = "\tproposition p implies q implies z";
            SyntacticElement parseResult = LineParser.Parse(line);

            Assert.AreEqual(typeof(InvalidSyntacticElement), parseResult.GetType());
        }
コード例 #4
0
        public void LineParser__NoPropositionSymbol_ReturnsInvalidSyntax()
        {
            string           line        = "\tproposition p q ";
            SyntacticElement parseResult = LineParser.Parse(line);

            Assert.AreEqual(typeof(InvalidSyntacticElement), parseResult.GetType());
        }
コード例 #5
0
        public void LineParser__NoPropositionSymbol_onepredicateNegated_ReturnsNotExpression()
        {
            string           line        = "\tproposition not(p) ";
            SyntacticElement parseResult = LineParser.Parse(line);

            Assert.AreEqual(typeof(PropositionNegationSyntacticElement), parseResult.GetType());
            Assert.AreEqual("not (p)", ((PropositionNegationSyntacticElement)parseResult).Text);
        }
コード例 #6
0
        public void LineParser_InValidCommentDefinition_ReturnsInvalidSyntacticElement()
        {   // syntax of a comment, each comment must start a new line,
            // no inline comments are allowed. comments are denoted by
            // note: there can be no space between the note and the :
            string line;

            line = "\tnote :p and q are mental";
            SyntacticElement parseResult = LineParser.Parse(line);

            Assert.AreEqual(typeof(InvalidSyntacticElement), parseResult.GetType());
        }