summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/Eo.cs
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-12-14 18:17:23 -0200
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2018-12-14 18:30:59 -0200
commita83c3cdba446c42d42b22b314ed6f91351e5234d (patch)
tree5e33da910696f07626d0de2fd1977306ed6c42d6 /src/tests/efl_mono/Eo.cs
parent0611dbc1e9bbf81026e7630a65766c325495bf47 (diff)
eolian_mono: Add support for C# style properties
Summary: Syntatic sugar around the Get/Set functions for now. Test Plan: Run efl-mono-suite Reviewers: vitor.sousa, segfaultxavi, felipealmeida, Jaehyun_Cho Reviewed By: vitor.sousa Subscribers: cedric Tags: #efl_language_bindings Differential Revision: https://phab.enlightenment.org/D7394
Diffstat (limited to 'src/tests/efl_mono/Eo.cs')
-rw-r--r--src/tests/efl_mono/Eo.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs
index 535c309e1c..7d5df72457 100644
--- a/src/tests/efl_mono/Eo.cs
+++ b/src/tests/efl_mono/Eo.cs
@@ -303,4 +303,46 @@ class TestEoMultipleChildClasses
303 } 303 }
304} 304}
305 305
306class TestCsharpProperties
307{
308 public static void test_csharp_properties()
309 {
310 var obj = new Dummy.TestObject();
311 var name = "My Name";
312 obj.Name = name;
313
314 Test.AssertEquals(name, obj.Name);
315 }
316
317 public static void test_getter_only()
318 {
319 var obj = new Dummy.TestObject();
320 Test.Assert(!obj.Invalidating);
321 }
322
323 public static void test_setter_only()
324 {
325 var obj = new Dummy.TestObject();
326 int val = -1984;
327
328 obj.SetterOnly = val;
329 Test.AssertEquals(val, obj.GetSetterOnly());
330 }
331
332 public static void test_class_property()
333 {
334 int val = -42;
335 Dummy.TestObject.KlassProp = val;
336 Test.AssertEquals(val, Dummy.TestObject.KlassProp);
337 }
338
339 public static void test_iface_property()
340 {
341 int val = -33;
342 Dummy.TestIface iface = new Dummy.TestObject();
343 iface.IfaceProp = val;
344 Test.AssertEquals(val, iface.IfaceProp);
345 }
346}
347
306} 348}