Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJb Evain <jb@evain.net>2016-10-14 18:57:03 +0300
committerJb Evain <jb@evain.net>2016-10-14 18:57:03 +0300
commit7fe43fc5402ae80084613af306e306826b2aba7a (patch)
tree6064105589760dfee07496d54e3b67388f2a889a /Test/Mono.Cecil.Tests
parent5ee6537cd42ab01ea59eeb6e0b06919096a33449 (diff)
Fix writing types in custom attributes that are arrays of nested types
Diffstat (limited to 'Test/Mono.Cecil.Tests')
-rw-r--r--Test/Mono.Cecil.Tests/CustomAttributesTests.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Test/Mono.Cecil.Tests/CustomAttributesTests.cs b/Test/Mono.Cecil.Tests/CustomAttributesTests.cs
index 210f5d6..29922ad 100644
--- a/Test/Mono.Cecil.Tests/CustomAttributesTests.cs
+++ b/Test/Mono.Cecil.Tests/CustomAttributesTests.cs
@@ -402,6 +402,29 @@ namespace Mono.Cecil.Tests {
}
[Test]
+ public void TypeOfArrayOfNestedClass ()
+ {
+ TestCSharp ("CustomAttributes.cs", module => {
+ var parent = module.GetType ("Parent");
+ Assert.IsNotNull (parent);
+
+ var attribute = GetAttribute (parent, "Foo");
+ Assert.IsNotNull (attribute);
+
+ Assert.AreEqual (1, attribute.ConstructorArguments.Count);
+
+ var argument = attribute.ConstructorArguments [0];
+
+ Assert.AreEqual ("System.Type", argument.Type.FullName);
+
+ var type = argument.Value as TypeReference;
+ Assert.IsNotNull (type);
+
+ Assert.AreEqual ("Parent/Child[]", type.FullName);
+ });
+ }
+
+ [Test]
public void EmptyBlob ()
{
TestIL ("ca-empty-blob.il", module => {