Example #1
0
 public void TestMethod()
 {
     ParseUtilCSharp.ParseExpression <ThisReferenceExpression>("this");
 }
Example #2
0
        public void UncheckedExpressionTest()
        {
            UncheckedExpression ce = ParseUtilCSharp.ParseExpression <UncheckedExpression>("unchecked(a)");

            Assert.IsTrue(ce.Expression is IdentifierExpression);
        }
Example #3
0
        public void BaseReferenceExpressionTest1()
        {
            MemberReferenceExpression fre = ParseUtilCSharp.ParseExpression <MemberReferenceExpression>("base.myField");

            Assert.IsTrue(fre.Target is BaseReferenceExpression);
        }
Example #4
0
        public void SimpleDefaultValue()
        {
            DefaultValueExpression toe = ParseUtilCSharp.ParseExpression <DefaultValueExpression>("default(T)");

            Assert.AreEqual("T", ((SimpleType)toe.Type).Identifier);
        }
Example #5
0
 public void IncompleteExpressionInArrayCreateExpression()
 {
     // test that the parser doesn't crash
     ParseUtilCSharp.ParseExpression <ArrayCreateExpression>("new int[sections.]", expectErrors: true);
 }
Example #6
0
        void CheckIdentifier(string sourceCode, string identifier)
        {
            IdentifierExpression ident = ParseUtilCSharp.ParseExpression <IdentifierExpression>(sourceCode);

            Assert.AreEqual(identifier, ident.Identifier);
        }