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>2019-06-25 00:34:53 +0300
committerJb Evain <jb@evain.net>2019-06-25 00:34:53 +0300
commit6e7bcbe3119353dc28f376743c228d2c255f47d5 (patch)
tree780ea4c67f71de3088e8536eb44005f9362d8df2 /Test/Mono.Cecil.Tests
parent6ba77d86beb7111d34ebc040a8f8e9f9fdad3f4d (diff)
Add test for attributes on generic parameter constraints
Diffstat (limited to 'Test/Mono.Cecil.Tests')
-rw-r--r--Test/Mono.Cecil.Tests/CustomAttributesTests.cs15
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 => {