Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2587 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
5 changed files with 34 additions and 63 deletions
@ -1,51 +0,0 @@ |
|||||||
// <file>
|
|
||||||
// <copyright see="prj:///doc/copyright.txt"/>
|
|
||||||
// <license see="prj:///doc/license.txt"/>
|
|
||||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
|
||||||
// <version>$Revision$</version>
|
|
||||||
// </file>
|
|
||||||
|
|
||||||
using System; |
|
||||||
using NUnit.Framework; |
|
||||||
using VBNetBinding.Parser; |
|
||||||
|
|
||||||
namespace VBNetBinding.Tests |
|
||||||
{ |
|
||||||
[TestFixture] |
|
||||||
public class ExpressionFinderTest |
|
||||||
{ |
|
||||||
ExpressionFinder ef; |
|
||||||
|
|
||||||
[SetUp] |
|
||||||
public void Init() |
|
||||||
{ |
|
||||||
ef = new ExpressionFinder(); |
|
||||||
} |
|
||||||
|
|
||||||
void Test(string expr, int offset) |
|
||||||
{ |
|
||||||
string fulltext = "Test\n " + expr + ".AnotherField \n TestEnde"; |
|
||||||
Assert.AreEqual(expr, ef.FindFullExpression(fulltext, 6 + offset).Expression); |
|
||||||
} |
|
||||||
|
|
||||||
[Test] |
|
||||||
public void FieldReference() |
|
||||||
{ |
|
||||||
Test("abc", 1); |
|
||||||
Test("abc.def", 6); |
|
||||||
} |
|
||||||
|
|
||||||
[Test] |
|
||||||
public void WithFieldReference() |
|
||||||
{ |
|
||||||
Test(".abc", 2); |
|
||||||
Test(".abc.def", 7); |
|
||||||
} |
|
||||||
|
|
||||||
[Test] |
|
||||||
public void MethodCall() |
|
||||||
{ |
|
||||||
Test("abc.Method().Method()", 16); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
Loading…
Reference in new issue