summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/Inheritance.cs
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-01-15 09:07:49 +0900
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-01-16 12:45:33 +0900
commit755d6080e0c03e75147b4401d68cb9da6f4441d5 (patch)
tree50664ff795ce8cbe4288e828e11370fe6f3b4234 /src/tests/efl_mono/Inheritance.cs
parent4858d9eb81f4aa5d24b9555b5caf0e058609d8ab (diff)
efl-mono: Add proper test for interface inheritance
Reviewers: segfaultxavi, bu5hm4n, woohyun, Jaehyun_Cho, lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7634
Diffstat (limited to 'src/tests/efl_mono/Inheritance.cs')
-rw-r--r--src/tests/efl_mono/Inheritance.cs53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/tests/efl_mono/Inheritance.cs b/src/tests/efl_mono/Inheritance.cs
new file mode 100644
index 0000000..30ca391
--- /dev/null
+++ b/src/tests/efl_mono/Inheritance.cs
@@ -0,0 +1,53 @@
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Runtime.InteropServices;
5using System.Runtime.CompilerServices;
6
7using EinaTestData;
8using static EinaTestData.BaseData;
9
10namespace TestSuite
11{
12
13class TestInheritance
14{
15 internal class Inherit1 : Dummy.TestObject
16 {
17 override public void IntOut (int x, out int y)
18 {
19 y = 10*x;
20 }
21 }
22
23 internal class Inherit2 : Dummy.TestObject, Dummy.InheritIface
24 {
25 override public void IntOut (int x, out int y)
26 {
27 y = 10*x;
28 }
29
30 public string StringshareTest (string i)
31 {
32 return "Hello World";
33 }
34 }
35
36 public static void test_inherit_from_regular_class()
37 {
38 var obj = new Inherit1();
39 int i = Dummy.InheritHelper.ReceiveDummyAndCallIntOut(obj);
40 Test.AssertEquals (50, i);
41 }
42
43 public static void test_inherit_from_iface()
44 {
45 var obj = new Inherit2();
46 int i = Dummy.InheritHelper.ReceiveDummyAndCallIntOut(obj);
47 string s = Dummy.InheritHelper.ReceiveDummyAndCallInStringshare(obj);
48 Test.AssertEquals (50, i);
49 Test.AssertEquals ("Hello World", s);
50 }
51}
52
53}