Skip to content

Commit

Permalink
Add test case for bug #185
Browse files Browse the repository at this point in the history
  • Loading branch information
jbevain committed Nov 11, 2014
1 parent 7e4c378 commit 69ade1d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Test/Mono.Cecil.Tests/CustomAttributesTests.cs
Expand Up @@ -317,6 +317,27 @@ public void FieldTypeOf ()
});
}

[Test]
public void EscapedTypeName ()
{
TestModule ("bug-185.dll", module => {
var foo = module.GetType ("Foo");
var foo_do = foo.Methods.Where (m => !m.IsConstructor).First ();
var attribute = foo_do.CustomAttributes.Where (ca => ca.AttributeType.Name == "AsyncStateMachineAttribute").First ();
Assert.AreEqual (foo.NestedTypes [0], attribute.ConstructorArguments [0].Value);
var function = module.GetType ("Function`1");
var apply = function.Methods.Where(m => !m.IsConstructor).First ();
attribute = apply.CustomAttributes.Where (ca => ca.AttributeType.Name == "AsyncStateMachineAttribute").First ();
Assert.AreEqual (function.NestedTypes [0], attribute.ConstructorArguments [0].Value);
});
}

[Test]
public void FieldNullTypeOf ()
{
Expand Down

0 comments on commit 69ade1d

Please sign in to comment.