diff options
Diffstat (limited to 'Test/Mono.Cecil.Tests/CustomAttributesTests.cs')
-rw-r--r-- | Test/Mono.Cecil.Tests/CustomAttributesTests.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Test/Mono.Cecil.Tests/CustomAttributesTests.cs b/Test/Mono.Cecil.Tests/CustomAttributesTests.cs index 74ae750..47bafc8 100644 --- a/Test/Mono.Cecil.Tests/CustomAttributesTests.cs +++ b/Test/Mono.Cecil.Tests/CustomAttributesTests.cs @@ -450,6 +450,21 @@ namespace Mono.Cecil.Tests { } [Test] + public void GenericParameterConstraint () + { + TestModule ("GenericParameterConstraintAttributes.dll", module => { + var type = module.GetType ("Foo.Library`1"); + var gp = type.GenericParameters.Single (); + var constraint = gp.Constraints.Single (); + + Assert.IsTrue (constraint.HasCustomAttributes); + var attributes = constraint.CustomAttributes; + Assert.AreEqual (1, attributes.Count); + Assert.AreEqual ("System.Runtime.CompilerServices.NullableAttribute", attributes [0].AttributeType.FullName); + }); + } + + [Test] public void NullCharInString () { TestCSharp ("CustomAttributes.cs", module => { |