Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@158 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
10 changed files with 177 additions and 29 deletions
@ -1,8 +1,8 @@ |
|||||||
Microsoft Visual Studio Solution File, Format Version 9.00 |
Microsoft Visual Studio Solution File, Format Version 9.00 |
||||||
# SharpDevelop 2.0.0.1 |
# SharpDevelop 2.0.0.1 |
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.Tests", "Test\NRefactoryTests.csproj", "{870115dd-960a-4406-a6b9-600bcdc36a03}" |
|
||||||
EndProject |
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory", "Project\NRefactory.csproj", "{3a9ae6aa-bc07-4a2f-972c-581e3ae2f195}" |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory", "Project\NRefactory.csproj", "{3a9ae6aa-bc07-4a2f-972c-581e3ae2f195}" |
||||||
EndProject |
EndProject |
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.Tests", "Test\NRefactoryTests.csproj", "{870115dd-960a-4406-a6b9-600bcdc36a03}" |
||||||
|
EndProject |
||||||
Global |
Global |
||||||
EndGlobal |
EndGlobal |
||||||
|
|||||||
@ -0,0 +1,48 @@ |
|||||||
|
/* |
||||||
|
* Created by SharpDevelop. |
||||||
|
* User: Daniel Grunwald |
||||||
|
* Date: 23.05.2005 |
||||||
|
* Time: 19:06 |
||||||
|
* |
||||||
|
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||||
|
*/ |
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Collections; |
||||||
|
using System.CodeDom; |
||||||
|
using NUnit.Framework; |
||||||
|
using ICSharpCode.NRefactory.Parser; |
||||||
|
using ICSharpCode.NRefactory.Parser.AST; |
||||||
|
|
||||||
|
namespace ICSharpCode.NRefactory.Tests.Output.CodeDom.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class InvocationExpressionsTests |
||||||
|
{ |
||||||
|
[Test] |
||||||
|
public void IdentifierOnlyInvocation() |
||||||
|
{ |
||||||
|
// InitializeComponents();
|
||||||
|
IdentifierExpression identifier = new IdentifierExpression("InitializeComponents"); |
||||||
|
InvocationExpression invocation = new InvocationExpression(identifier, new ArrayList()); |
||||||
|
object output = invocation.AcceptVisitor(new CodeDOMVisitor(), null); |
||||||
|
Assert.IsTrue(output is CodeMethodInvokeExpression); |
||||||
|
CodeMethodInvokeExpression mie = (CodeMethodInvokeExpression)output; |
||||||
|
Assert.AreEqual("InitializeComponents", mie.Method.MethodName); |
||||||
|
Assert.IsTrue(mie.Method.TargetObject is CodeThisReferenceExpression); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void MethodOnThisReferenceInvocation() |
||||||
|
{ |
||||||
|
// InitializeComponents();
|
||||||
|
FieldReferenceExpression field = new FieldReferenceExpression(new ThisReferenceExpression(), "InitializeComponents"); |
||||||
|
InvocationExpression invocation = new InvocationExpression(field, new ArrayList()); |
||||||
|
object output = invocation.AcceptVisitor(new CodeDOMVisitor(), null); |
||||||
|
Assert.IsTrue(output is CodeMethodInvokeExpression); |
||||||
|
CodeMethodInvokeExpression mie = (CodeMethodInvokeExpression)output; |
||||||
|
Assert.AreEqual("InitializeComponents", mie.Method.MethodName); |
||||||
|
Assert.IsTrue(mie.Method.TargetObject is CodeThisReferenceExpression); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue