Axiom.Compiler.Framework.Unit_Tests.PrologCodeParserTest.Parse_Fact_no_Args C# (CSharp) Method

Parse_Fact_no_Args() private method

private Parse_Fact_no_Args ( ) : void
return void
        public void Parse_Fact_no_Args()
        {
            // Try to parse 'predicate.'
            Write("factnoargs.txt", "predicate.");

            StreamReader sr = new StreamReader("C:\\factnoargs.txt");

            PrologCodeParser parser = new PrologCodeParser();
            parser.Scanner = new PrologScanner(sr);

            BinaryTree ast = parser.Term(1200);
            sr.Close();

            // Expect: BinaryTree("predicate", null, null, null);
            Assert.AreEqual("predicate", ast.Name);
            Assert.IsNull(ast.Left);
            Assert.IsNull(ast.Right);
            Assert.IsNull(ast.Arguments);
        }