diff options
author | Jb Evain <jb@evain.net> | 2016-10-14 18:57:03 +0300 |
---|---|---|
committer | Jb Evain <jb@evain.net> | 2016-10-14 18:57:03 +0300 |
commit | 7fe43fc5402ae80084613af306e306826b2aba7a (patch) | |
tree | 6064105589760dfee07496d54e3b67388f2a889a /Test/Mono.Cecil.Tests | |
parent | 5ee6537cd42ab01ea59eeb6e0b06919096a33449 (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.cs | 23 |
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 => { |