expressionfindertest.cs
来自「SharpDevelop2.0.0 c#开发免费工具」· CS 代码 · 共 52 行
CS
52 行
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision: 915 $</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);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?