|
|
|
|
@ -32,6 +32,16 @@ namespace ICSharpCode.NRefactory.Tests.AST
@@ -32,6 +32,16 @@ namespace ICSharpCode.NRefactory.Tests.AST
|
|
|
|
|
Assert.AreEqual("System.Char", expr.TypeArguments[0].SystemType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CheckGenericInvoke2(InvocationExpression expr) |
|
|
|
|
{ |
|
|
|
|
Assert.AreEqual(0, expr.Arguments.Count); |
|
|
|
|
Assert.IsTrue(expr.TargetObject is IdentifierExpression); |
|
|
|
|
Assert.AreEqual("myMethod", ((IdentifierExpression)expr.TargetObject).Identifier); |
|
|
|
|
Assert.AreEqual(2, expr.TypeArguments.Count); |
|
|
|
|
Assert.AreEqual("T", expr.TypeArguments[0].SystemType); |
|
|
|
|
Assert.AreEqual("System.Boolean", expr.TypeArguments[1].SystemType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region C#
|
|
|
|
|
[Test] |
|
|
|
|
@ -46,6 +56,12 @@ namespace ICSharpCode.NRefactory.Tests.AST
@@ -46,6 +56,12 @@ namespace ICSharpCode.NRefactory.Tests.AST
|
|
|
|
|
CheckGenericInvoke(ParseUtilCSharp.ParseExpression<InvocationExpression>("myMethod<char>('a')")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void CSharpGenericInvocation2ExpressionTest() |
|
|
|
|
{ |
|
|
|
|
CheckGenericInvoke2(ParseUtilCSharp.ParseExpression<InvocationExpression>("myMethod<T,bool>()")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void CSharpInvalidNestedInvocationExpressionTest() |
|
|
|
|
{ |
|
|
|
|
@ -75,6 +91,12 @@ namespace ICSharpCode.NRefactory.Tests.AST
@@ -75,6 +91,12 @@ namespace ICSharpCode.NRefactory.Tests.AST
|
|
|
|
|
CheckGenericInvoke(ParseUtilVBNet.ParseExpression<InvocationExpression>("myMethod(Of Char)(\"a\"c)")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void VBNetGenericInvocation2ExpressionTest() |
|
|
|
|
{ |
|
|
|
|
CheckGenericInvoke2(ParseUtilVBNet.ParseExpression<InvocationExpression>("myMethod(Of T, Boolean)()")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void PrimitiveExpression1Test() |
|
|
|
|
{ |
|
|
|
|
|