Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@886 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
7 changed files with 152 additions and 21 deletions
@ -0,0 +1,53 @@
@@ -0,0 +1,53 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: DG |
||||
* Date: 13.12.2005 |
||||
* Time: 19:58 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
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); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,57 @@
@@ -0,0 +1,57 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<PropertyGroup> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>VBNetBinding.Tests</RootNamespace> |
||||
<AssemblyName>VBNetBinding.Tests</AssemblyName> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProjectGuid>{50A89267-A28B-4DF3-8E62-912E005143B8}</ProjectGuid> |
||||
<OutputPath>..\..\..\..\..\bin\UnitTests\</OutputPath> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<NoStdLib>False</NoStdLib> |
||||
<RegisterForComInterop>False</RegisterForComInterop> |
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||
<BaseAddress>4194304</BaseAddress> |
||||
<PlatformTarget>AnyCPU</PlatformTarget> |
||||
<FileAlignment>4096</FileAlignment> |
||||
<WarningLevel>4</WarningLevel> |
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||
<Optimize>False</Optimize> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
<DebugSymbols>False</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Data" /> |
||||
<Reference Include="System.Drawing" /> |
||||
<Reference Include="System.Windows.Forms" /> |
||||
<Reference Include="System.Xml" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="ExpressionFinderTest.cs" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\..\..\..\Libraries\NUnit.Framework\nunit.framework.dll.csproj"> |
||||
<Project>{83DD7E12-A705-4DBA-9D71-09C8973D9382}</Project> |
||||
<Name>nunit.framework.dll</Name> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\Project\VBNetBinding.csproj"> |
||||
<Project>{BF38FB72-B380-4196-AF8C-95749D726C61}</Project> |
||||
<Name>VBNetBinding</Name> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj"> |
||||
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project> |
||||
<Name>ICSharpCode.SharpDevelop</Name> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
</Project> |
Loading…
Reference in new issue