diff options
author | Jb Evain <jb@evain.net> | 2016-07-15 06:13:34 +0300 |
---|---|---|
committer | Jb Evain <jb@evain.net> | 2016-07-15 06:13:34 +0300 |
commit | dafce85a928b18f6b2437ae304c23c03c6258b8f (patch) | |
tree | a4f20d8930c6155a563ffddd16eebab86590bdd0 /Test/Mono.Cecil.Tests | |
parent | eef91471d52bbc86a310336d799ee1feb35b5380 (diff) | |
parent | 6923cc7f40973af6336190bfa6cad1249afe53e8 (diff) |
Merge branch 'iface-impl-ca'
Diffstat (limited to 'Test/Mono.Cecil.Tests')
-rw-r--r-- | Test/Mono.Cecil.Tests/CustomAttributesTests.cs | 17 | ||||
-rw-r--r-- | Test/Mono.Cecil.Tests/TypeTests.cs | 6 |
2 files changed, 19 insertions, 4 deletions
diff --git a/Test/Mono.Cecil.Tests/CustomAttributesTests.cs b/Test/Mono.Cecil.Tests/CustomAttributesTests.cs index 0b4ae44..210f5d6 100644 --- a/Test/Mono.Cecil.Tests/CustomAttributesTests.cs +++ b/Test/Mono.Cecil.Tests/CustomAttributesTests.cs @@ -33,7 +33,7 @@ namespace Mono.Cecil.Tests { AssertArgument ("bar", attribute.ConstructorArguments [0]); }); - } + } [Test] public void NullString () @@ -412,6 +412,21 @@ namespace Mono.Cecil.Tests { } [Test] + public void InterfaceImplementation () + { + IgnoreOnMono(); + + TestIL ("ca-iface-impl.il", module => { + var type = module.GetType ("FooType"); + var iface = type.Interfaces.Single (i => i.InterfaceType.FullName == "IFoo"); + Assert.IsTrue (iface.HasCustomAttributes); + var attributes = iface.CustomAttributes; + Assert.AreEqual (1, attributes.Count); + Assert.AreEqual ("FooAttribute", attributes [0].AttributeType.FullName); + }); + } + + [Test] public void DefineCustomAttributeFromBlob () { var file = Path.Combine (Path.GetTempPath (), "CaBlob.dll"); diff --git a/Test/Mono.Cecil.Tests/TypeTests.cs b/Test/Mono.Cecil.Tests/TypeTests.cs index 87bf8b1..1bf834a 100644 --- a/Test/Mono.Cecil.Tests/TypeTests.cs +++ b/Test/Mono.Cecil.Tests/TypeTests.cs @@ -44,8 +44,8 @@ namespace Mono.Cecil.Tests { Assert.AreEqual (2, interfaces.Count); // Mono's ilasm and .NET's are ordering interfaces differently - Assert.IsNotNull (interfaces.Single (i => i.FullName == "IBar")); - Assert.IsNotNull (interfaces.Single (i => i.FullName == "IFoo")); + Assert.IsNotNull (interfaces.Single (i => i.InterfaceType.FullName == "IBar")); + Assert.IsNotNull (interfaces.Single (i => i.InterfaceType.FullName == "IFoo")); }); } @@ -181,7 +181,7 @@ namespace Mono.Cecil.Tests { var type = module.GetType ("Program"); var iface = type.Interfaces [0]; - var instance = (GenericInstanceType) iface; + var instance = (GenericInstanceType) iface.InterfaceType; var owner = instance.ElementType; Assert.AreEqual (1, instance.GenericArguments.Count); |