|
|
|
|
@ -21,6 +21,7 @@ using System.IO;
@@ -21,6 +21,7 @@ using System.IO;
|
|
|
|
|
using System.Linq; |
|
|
|
|
using ICSharpCode.NRefactory.TypeSystem; |
|
|
|
|
using ICSharpCode.NRefactory.TypeSystem.Implementation; |
|
|
|
|
using ICSharpCode.NRefactory.TypeSystem.TestCase; |
|
|
|
|
using ICSharpCode.NRefactory.Utils; |
|
|
|
|
using NUnit.Framework; |
|
|
|
|
|
|
|
|
|
@ -60,6 +61,25 @@ namespace ICSharpCode.NRefactory.CSharp.Parser
@@ -60,6 +61,25 @@ namespace ICSharpCode.NRefactory.CSharp.Parser
|
|
|
|
|
Assert.IsTrue(method.IsExplicitInterfaceImplementation); |
|
|
|
|
Assert.AreEqual("System.IDisposable.Dispose", method.InterfaceImplementations.Single().FullName); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void ExplicitGenericInterfaceImplementation() |
|
|
|
|
{ |
|
|
|
|
ITypeDefinition impl = GetTypeDefinition(typeof(NRefactory.TypeSystem.TestCase.ExplicitGenericInterfaceImplementation)); |
|
|
|
|
IType genericInterfaceOfString = compilation.FindType(typeof(IGenericInterface<string>)); |
|
|
|
|
IMethod implMethod1 = impl.Methods.Single(m => m.Name == "Test" && !m.Parameters[1].IsRef); |
|
|
|
|
IMethod implMethod2 = impl.Methods.Single(m => m.Name == "Test" && m.Parameters[1].IsRef); |
|
|
|
|
Assert.IsTrue(implMethod1.IsExplicitInterfaceImplementation); |
|
|
|
|
Assert.IsTrue(implMethod2.IsExplicitInterfaceImplementation); |
|
|
|
|
|
|
|
|
|
IMethod interfaceMethod1 = (IMethod)implMethod1.InterfaceImplementations.Single(); |
|
|
|
|
Assert.AreEqual(genericInterfaceOfString, interfaceMethod1.DeclaringType); |
|
|
|
|
Assert.IsTrue(!interfaceMethod1.Parameters[1].IsRef); |
|
|
|
|
|
|
|
|
|
IMethod interfaceMethod2 = (IMethod)implMethod2.InterfaceImplementations.Single(); |
|
|
|
|
Assert.AreEqual(genericInterfaceOfString, interfaceMethod2.DeclaringType); |
|
|
|
|
Assert.IsTrue(interfaceMethod2.Parameters[1].IsRef); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[TestFixture] |
|
|
|
|
|