Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain McCoy <iainmc@mono-cvs.ximian.com>2005-07-23 17:27:21 +0400
committerIain McCoy <iainmc@mono-cvs.ximian.com>2005-07-23 17:27:21 +0400
commit43b0dc2bcd858355110814ac244bb3678f8beea0 (patch)
tree62a4381b610b1faa824d12c46bd744124f38ae25 /mcs/class/PresentationFramework
parente5ddfe7dab81166095dce9cd1a9d617eb5a52b3d (diff)
2005-07-23 Iain McCoy <iain@mccoy.id.au>
* Test/CodeWriter.cs: added tests for events and for delegates as property values svn path=/trunk/mcs/; revision=47587
Diffstat (limited to 'mcs/class/PresentationFramework')
-rw-r--r--mcs/class/PresentationFramework/ChangeLog2
-rw-r--r--mcs/class/PresentationFramework/Test/CodeWriter.cs43
2 files changed, 45 insertions, 0 deletions
diff --git a/mcs/class/PresentationFramework/ChangeLog b/mcs/class/PresentationFramework/ChangeLog
index 5abbe97728d..f7e2da8cb5c 100644
--- a/mcs/class/PresentationFramework/ChangeLog
+++ b/mcs/class/PresentationFramework/ChangeLog
@@ -2,6 +2,8 @@
* Test/XamlParser.cs: added test for events and delegates as property
values
+ * Test/CodeWriter.cs: added tests for events and for delegates as
+ property values
2005-07-19 Iain McCoy <iain@mccoy.id.au>
diff --git a/mcs/class/PresentationFramework/Test/CodeWriter.cs b/mcs/class/PresentationFramework/Test/CodeWriter.cs
index 976f288981c..4c3ce769058 100644
--- a/mcs/class/PresentationFramework/Test/CodeWriter.cs
+++ b/mcs/class/PresentationFramework/Test/CodeWriter.cs
@@ -247,6 +247,49 @@ public class CodeWriterTest {
);
}
+ [Test]
+ public void TestEvent()
+ {
+ cw.CreateTopLevel(typeof(ConsoleApp), null);
+ cw.CreateEvent(typeof(ConsoleApp).GetEvent("SomethingHappened"));
+ cw.CreateEventDelegate("handleSomething", typeof(SomethingHappenedHandler));
+ cw.EndEvent();
+ cw.EndObject();
+ cw.Finish();
+ compare(
+ "namespace DefaultNamespace {\n"+
+ " public class derivedConsoleApp: Xaml.TestVocab.Console.ConsoleApp {\n" +
+ " private derivedConsoleApp() {\n"+
+ " this.SomethingHappened += new Xaml.TestVocab.Console.SomethingHappenedHandler(this.handleSomething);\n"+
+ " }\n" +
+ " }\n" +
+ "}"
+ );
+ }
+
+ [Test]
+ public void TestDelegateAsPropertyValue()
+ {
+ cw.CreateTopLevel(typeof(ConsoleApp), null);
+ cw.CreateObject(typeof(ConsoleWriter), null);
+ cw.CreateProperty(typeof(ConsoleWriter).GetProperty("Filter"));
+ cw.CreatePropertyDelegate("filterfilter", typeof(Filter));
+ cw.EndProperty();
+ cw.EndObject();
+ cw.EndObject();
+ cw.Finish();
+ compare(
+ "namespace DefaultNamespace {\n"+
+ " public class derivedConsoleApp: Xaml.TestVocab.Console.ConsoleApp {\n" +
+ " private derivedConsoleApp() {\n"+
+ " Xaml.TestVocab.Console.ConsoleWriter consoleWriter1 = new Xaml.TestVocab.Console.ConsoleWriter();\n"+
+ " this.AddChild(consoleWriter1);\n" +
+ " consoleWriter1.Filter = new Xaml.TestVocab.Console.Filter(this.filterfilter);\n" +
+ " }\n" +
+ " }\n" +
+ "}"
+ );
+ }
private void compare(string expected)