Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4961 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
48 changed files with 1357 additions and 880 deletions
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,52 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Daniel Grunwald"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using ICSharpCode.SharpDevelop.Dom.CSharp; |
||||||
|
using System; |
||||||
|
using System.Linq; |
||||||
|
using NUnit.Framework; |
||||||
|
|
||||||
|
namespace ICSharpCode.SharpDevelop.Dom.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class CSharpAmbienceTests |
||||||
|
{ |
||||||
|
CSharpAmbience fullMemberNameAmbience; |
||||||
|
IClass valueCollection; |
||||||
|
|
||||||
|
[TestFixtureSetUpAttribute] |
||||||
|
public void FixtureSetUp() |
||||||
|
{ |
||||||
|
valueCollection = SharedProjectContentRegistryForTests.Instance.Mscorlib.GetClass("System.Collections.Generic.Dictionary.ValueCollection", 2); |
||||||
|
Assert.AreEqual(2, valueCollection.TypeParameters.Count); |
||||||
|
Assert.AreEqual(2, valueCollection.DeclaringType.TypeParameters.Count); |
||||||
|
|
||||||
|
fullMemberNameAmbience = new CSharpAmbience(); |
||||||
|
fullMemberNameAmbience.ConversionFlags = ConversionFlags.StandardConversionFlags | ConversionFlags.UseFullyQualifiedMemberNames; |
||||||
|
} |
||||||
|
|
||||||
|
[TestAttribute] |
||||||
|
public void TestFullClassNameOfClassInsideGenericClass() |
||||||
|
{ |
||||||
|
Assert.AreEqual("public sealed class System.Collections.Generic.Dictionary<TKey, TValue>.ValueCollection", fullMemberNameAmbience.Convert(valueCollection)); |
||||||
|
} |
||||||
|
|
||||||
|
[TestAttribute] |
||||||
|
public void TestFullNameOfValueCollectionCountProperty() |
||||||
|
{ |
||||||
|
IProperty count = valueCollection.Properties.Single(p => p.Name == "Count"); |
||||||
|
Assert.AreEqual("public sealed int System.Collections.Generic.Dictionary<TKey, TValue>.ValueCollection.Count", fullMemberNameAmbience.Convert(count)); |
||||||
|
} |
||||||
|
|
||||||
|
[TestAttribute] |
||||||
|
public void TestFullNameOfValueCollectionCopyToMethod() |
||||||
|
{ |
||||||
|
IMethod copyTo = valueCollection.Methods.Single(m => m.Name == "CopyTo"); |
||||||
|
Assert.AreEqual("public sealed void System.Collections.Generic.Dictionary<TKey, TValue>.ValueCollection.CopyTo(TValue[] array, int index)", fullMemberNameAmbience.Convert(copyTo)); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,53 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Daniel Grunwald"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
|
||||||
|
using ICSharpCode.SharpDevelop.Dom.VBNet; |
||||||
|
using System; |
||||||
|
using System.Linq; |
||||||
|
using NUnit.Framework; |
||||||
|
|
||||||
|
namespace ICSharpCode.SharpDevelop.Dom.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class VBNetAmbienceTests |
||||||
|
{ |
||||||
|
VBNetAmbience fullMemberNameAmbience; |
||||||
|
IClass valueCollection; |
||||||
|
|
||||||
|
[TestFixtureSetUpAttribute] |
||||||
|
public void FixtureSetUp() |
||||||
|
{ |
||||||
|
valueCollection = SharedProjectContentRegistryForTests.Instance.Mscorlib.GetClass("System.Collections.Generic.Dictionary.ValueCollection", 2); |
||||||
|
Assert.AreEqual(2, valueCollection.TypeParameters.Count); |
||||||
|
Assert.AreEqual(2, valueCollection.DeclaringType.TypeParameters.Count); |
||||||
|
|
||||||
|
fullMemberNameAmbience = new VBNetAmbience(); |
||||||
|
fullMemberNameAmbience.ConversionFlags = ConversionFlags.StandardConversionFlags | ConversionFlags.UseFullyQualifiedMemberNames; |
||||||
|
} |
||||||
|
|
||||||
|
[TestAttribute] |
||||||
|
public void TestFullClassNameOfClassInsideGenericClass() |
||||||
|
{ |
||||||
|
Assert.AreEqual("Public NotInheritable Class System.Collections.Generic.Dictionary(Of TKey, TValue).ValueCollection", fullMemberNameAmbience.Convert(valueCollection)); |
||||||
|
} |
||||||
|
|
||||||
|
[TestAttribute] |
||||||
|
public void TestFullNameOfValueCollectionCountProperty() |
||||||
|
{ |
||||||
|
IProperty count = valueCollection.Properties.Single(p => p.Name == "Count"); |
||||||
|
Assert.AreEqual("Public NotOverridable ReadOnly Property System.Collections.Generic.Dictionary(Of TKey, TValue).ValueCollection.Count As Integer", fullMemberNameAmbience.Convert(count)); |
||||||
|
} |
||||||
|
|
||||||
|
[TestAttribute] |
||||||
|
public void TestFullNameOfValueCollectionCopyToMethod() |
||||||
|
{ |
||||||
|
IMethod copyTo = valueCollection.Methods.Single(m => m.Name == "CopyTo"); |
||||||
|
Assert.AreEqual("Public NotOverridable Sub System.Collections.Generic.Dictionary(Of TKey, TValue).ValueCollection.CopyTo(array As TValue(), index As Integer)", fullMemberNameAmbience.Convert(copyTo)); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue