summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/Structs.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/efl_mono/Structs.cs')
-rw-r--r--src/tests/efl_mono/Structs.cs38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/tests/efl_mono/Structs.cs b/src/tests/efl_mono/Structs.cs
index 60be42e..521d39b 100644
--- a/src/tests/efl_mono/Structs.cs
+++ b/src/tests/efl_mono/Structs.cs
@@ -421,4 +421,42 @@ internal class TestStructEquality
421 } 421 }
422} 422}
423 423
424internal class TestStructTuples
425{
426 private static Eina.Position2D simulate_position_usage(Eina.Position2D p) {
427 return p;
428 }
429
430 public static void test_same_type_fields_assign_conversion() {
431 Eina.Position2D p = (1, 2);
432 Test.AssertEquals(p.X, 1);
433 Test.AssertEquals(p.Y, 2);
434 }
435
436 public static void test_same_type_fields_call_conversion() {
437 var p = simulate_position_usage((1, 2));
438 Test.AssertEquals(p.X, 1);
439 Test.AssertEquals(p.Y, 2);
440 }
441
442 public static void test_different_type_fields_assign_conversion() {
443 Efl.Ui.FormatValue v = (1, "Format");
444 Test.AssertEquals(v.Value, 1);
445 Test.AssertEquals(v.Text, "Format");
446 }
447
448 public static void test_complex_fields_assign_conversion() {
449 var pos = new Eina.Position2D(1, 2);
450 var action = Efl.Ui.SelectionAction.Unknown;
451 var format = Efl.Ui.SelectionFormat.None;
452 var item = null as Efl.Canvas.Vg.Object;
453
454 Efl.Dnd.DragPos attr = (pos, action, format, item);
455 Test.AssertEquals(attr.Pos, pos);
456 Test.AssertEquals(attr.Action, action);
457 Test.AssertEquals(attr.Format, format);
458 Test.AssertEquals(attr.Item, item);
459 }
460}
461
424} 462}