~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/Main/ICSharpCode.SharpDevelop.Dom/Tests/ICSharpCode.SharpDevelop.Dom.Tests/VBNetAmbienceTests.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using ICSharpCode.SharpDevelop.Dom.VBNet;
 
5
using System;
 
6
using System.Linq;
 
7
using NUnit.Framework;
 
8
 
 
9
namespace ICSharpCode.SharpDevelop.Dom.Tests
 
10
{
 
11
        [TestFixture]
 
12
        public class VBNetAmbienceTests
 
13
        {
 
14
                VBNetAmbience fullMemberNameAmbience;
 
15
                IClass valueCollection;
 
16
                
 
17
                [TestFixtureSetUpAttribute]
 
18
                public void FixtureSetUp()
 
19
                {
 
20
                        valueCollection = SharedProjectContentRegistryForTests.Instance.Mscorlib.GetClass("System.Collections.Generic.Dictionary.ValueCollection", 2);
 
21
                        Assert.AreEqual(2, valueCollection.TypeParameters.Count);
 
22
                        Assert.AreEqual(2, valueCollection.DeclaringType.TypeParameters.Count);
 
23
                        
 
24
                        fullMemberNameAmbience = new VBNetAmbience();
 
25
                        fullMemberNameAmbience.ConversionFlags = ConversionFlags.StandardConversionFlags | ConversionFlags.UseFullyQualifiedMemberNames;
 
26
                }
 
27
                
 
28
                [TestAttribute]
 
29
                public void TestFullClassNameOfClassInsideGenericClass()
 
30
                {
 
31
                        Assert.AreEqual("Public NotInheritable Class System.Collections.Generic.Dictionary(Of TKey, TValue).ValueCollection", fullMemberNameAmbience.Convert(valueCollection));
 
32
                }
 
33
                
 
34
                [TestAttribute]
 
35
                public void TestFullNameOfValueCollectionCountProperty()
 
36
                {
 
37
                        IProperty count = valueCollection.Properties.Single(p => p.Name == "Count");
 
38
                        Assert.AreEqual("Public NotOverridable ReadOnly Property System.Collections.Generic.Dictionary(Of TKey, TValue).ValueCollection.Count As Integer", fullMemberNameAmbience.Convert(count));
 
39
                }
 
40
                
 
41
                [TestAttribute]
 
42
                public void TestFullNameOfValueCollectionCopyToMethod()
 
43
                {
 
44
                        IMethod copyTo = valueCollection.Methods.Single(m => m.Name == "CopyTo");
 
45
                        Assert.AreEqual("Public NotOverridable Sub System.Collections.Generic.Dictionary(Of TKey, TValue).ValueCollection.CopyTo(array As TValue(), index As Integer)", fullMemberNameAmbience.Convert(copyTo));
 
46
                }
 
47
        }
 
48
}