public void TestMethod() { ParseUtilCSharp.ParseExpression <ThisReferenceExpression>("this"); }
public void UncheckedExpressionTest() { UncheckedExpression ce = ParseUtilCSharp.ParseExpression <UncheckedExpression>("unchecked(a)"); Assert.IsTrue(ce.Expression is IdentifierExpression); }
public void BaseReferenceExpressionTest1() { MemberReferenceExpression fre = ParseUtilCSharp.ParseExpression <MemberReferenceExpression>("base.myField"); Assert.IsTrue(fre.Target is BaseReferenceExpression); }
public void SimpleDefaultValue() { DefaultValueExpression toe = ParseUtilCSharp.ParseExpression <DefaultValueExpression>("default(T)"); Assert.AreEqual("T", ((SimpleType)toe.Type).Identifier); }
public void IncompleteExpressionInArrayCreateExpression() { // test that the parser doesn't crash ParseUtilCSharp.ParseExpression <ArrayCreateExpression>("new int[sections.]", expectErrors: true); }
void CheckIdentifier(string sourceCode, string identifier) { IdentifierExpression ident = ParseUtilCSharp.ParseExpression <IdentifierExpression>(sourceCode); Assert.AreEqual(identifier, ident.Identifier); }