diff options
author | Lluis Sanchez Gual <lluis@novell.com> | 2011-02-25 13:33:11 +0300 |
---|---|---|
committer | Lluis Sanchez <lluis@novell.com> | 2011-02-25 16:55:20 +0300 |
commit | c78747de09d0e18f5a4c1501a2963ee03f65c072 (patch) | |
tree | 3f93786561cac1dc224c1521a0e7bbb753b922ad /Test | |
parent | acca7790805a9652c597f7ac9bbf0dc77c755707 (diff) |
Fix bug in custom attributes.
The add-in scanner was setting the 'id' of nodes defined using custom
attributes, but not the 'type'. This did work as long as the 'id' of
the node was not changed (since the 'id' is used as type if 'type' is
not specified), but if the 'id' was changed, it would fail.
Diffstat (limited to 'Test')
-rw-r--r-- | Test/HelloWorldExtension/HelloWriterWithMetadata.cs | 2 | ||||
-rw-r--r-- | Test/UnitTests/TestExtensions.cs | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/Test/HelloWorldExtension/HelloWriterWithMetadata.cs b/Test/HelloWorldExtension/HelloWriterWithMetadata.cs index 127808b..cb3833e 100644 --- a/Test/HelloWorldExtension/HelloWriterWithMetadata.cs +++ b/Test/HelloWorldExtension/HelloWriterWithMetadata.cs @@ -29,7 +29,7 @@ using SimpleApp; namespace HelloWorldExtension { - [WriterWithMetadata ("meta1", 1)] + [WriterWithMetadata ("meta1", 1, Id="xxx")] public class HelloWriterWithMetadata: IWriterWithMetadata { public string Write () diff --git a/Test/UnitTests/TestExtensions.cs b/Test/UnitTests/TestExtensions.cs index b980487..0025577 100644 --- a/Test/UnitTests/TestExtensions.cs +++ b/Test/UnitTests/TestExtensions.cs @@ -162,8 +162,12 @@ namespace UnitTests Assert.IsNotNull (n2); Assert.AreEqual ("meta1", n1.Data.Name, "t1"); Assert.AreEqual (1, n1.Data.Version, "t2"); + IWriterWithMetadata md = (IWriterWithMetadata) n1.CreateInstance (); + Assert.AreEqual ("mt1", md.Write ()); Assert.AreEqual ("meta2", n2.Data.Name, "t3"); Assert.AreEqual (2, n2.Data.Version, "t4"); + md = (IWriterWithMetadata) n2.CreateInstance (); + Assert.AreEqual ("mt2", md.Write ()); } [Test()] |