aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-03-15 12:20:48 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-03-15 18:23:10 -0300
commitcd8b3d580f36f44b8218dc2789a42d4ce778b161 (patch)
tree2ec768087fc0ef90ea26704aae4dd20a44543d8d
parentcsharp: Change event trigger from On_Foo to OnFoo (diff)
downloadefl-devs/lauromoura/interface_events.tar.gz
csharp: WIP - Test OnEvet methods.devs/lauromoura/interface_events
-rw-r--r--src/tests/efl_mono/Events.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/tests/efl_mono/Events.cs b/src/tests/efl_mono/Events.cs
index 4a6032c691..305841b9b5 100644
--- a/src/tests/efl_mono/Events.cs
+++ b/src/tests/efl_mono/Events.cs
@@ -254,6 +254,41 @@ class TestInterfaceEvents
}
}
+class TestEventTriggerFromCSharpChild
+{
+ private class Child : Dummy.TestObject
+ {
+ public Child() : base(null) { }
+
+ public void TriggerEvent(int value)
+ {
+ var args = new Dummy.TestObjectEvtWithIntEvt_Args();
+ args.arg = value;
+ OnEvtWithIntEvt(args);
+ }
+ }
+
+ public static void managed_event_callback()
+ {
+ var obj = new Child();
+ int received = -1;
+ int sent = 42;
+ obj.EvtWithIntEvt += (object sender, Dummy.TestObjectEvtWithIntEvt_Args e) => {
+ received = e.arg;
+ };
+
+ obj.TriggerEvent(sent);
+
+ Test.AssertEquals(received, sent);
+ }
+
+ public static void native_event_callback()
+ {
+ var obj = new Child();
+ //FIXME hook to native callback.
+ }
+}
+
class TestEventNaming
{
// For events named line focus_geometry,changed