summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/Parts.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/efl_mono/Parts.cs')
-rw-r--r--src/tests/efl_mono/Parts.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/tests/efl_mono/Parts.cs b/src/tests/efl_mono/Parts.cs
index bf47fed..3e2da24 100644
--- a/src/tests/efl_mono/Parts.cs
+++ b/src/tests/efl_mono/Parts.cs
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#define CODE_ANALYSIS 16#define CODE_ANALYSIS
2 17
3#pragma warning disable 1591 18#pragma warning disable 1591
@@ -16,6 +31,7 @@ public static class TestParts
16 { 31 {
17 var t = new Dummy.PartHolder(); 32 var t = new Dummy.PartHolder();
18 do_part_test(t); 33 do_part_test(t);
34 t.Dispose();
19 } 35 }
20 36
21 private class Child : Dummy.PartHolder 37 private class Child : Dummy.PartHolder
@@ -26,6 +42,7 @@ public static class TestParts
26 public static void inherited_part_test() { 42 public static void inherited_part_test() {
27 var t = new Child(); 43 var t = new Child();
28 do_part_test(t); 44 do_part_test(t);
45 t.Dispose();
29 } 46 }
30 47
31 private static void do_part_test(Dummy.PartHolder t) 48 private static void do_part_test(Dummy.PartHolder t)
@@ -51,6 +68,8 @@ public static class TestMVVMParts
51 var error = bindablePart.Markup().Bind("name"); 68 var error = bindablePart.Markup().Bind("name");
52 69
53 Test.AssertEquals(error, Eina.Error.NO_ERROR); 70 Test.AssertEquals(error, Eina.Error.NO_ERROR);
71 factory.Dispose();
72 parent.Dispose();
54 } 73 }
55 74
56 public static void mvvm_factory_properties() 75 public static void mvvm_factory_properties()
@@ -63,6 +82,24 @@ public static class TestMVVMParts
63 var error = factory.IconPart().BindFactory(iconFactory); 82 var error = factory.IconPart().BindFactory(iconFactory);
64 83
65 Test.AssertEquals(error, Eina.Error.NO_ERROR); 84 Test.AssertEquals(error, Eina.Error.NO_ERROR);
85 iconFactory.Dispose();
86 factory.Dispose();
87 parent.Dispose();
88 }
89}
90
91public static class TestNamedParts
92{
93 public static void named_parts()
94 {
95 var obj = new Dummy.PartHolder();
96 var p1 = obj.GetPart("one");
97 var p2 = obj.GetPart("two");
98 Test.Assert(p1 is Dummy.TestObject);
99 Test.AssertEquals("part_one", p1.GetName());
100 Test.Assert(p2 is Dummy.TestObject);
101 Test.AssertEquals("part_two", p2.GetName());
102 obj.Dispose();
66 } 103 }
67} 104}
68 105