summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/Eo.cs
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-11-19 01:48:01 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-11-19 21:49:35 -0300
commitb1eb794a913e753929635aa80aeab8c2211db462 (patch)
treed36a71f0f1ba8a08de8d1e3078917088e1d07b59 /src/tests/efl_mono/Eo.cs
parente36b1930bf04694fb67dd7e741dbcb5231bf5e58 (diff)
csharp: Fix CA1815 for generated structs and aliases
Summary: Adds IEquatable<T> and friends. Reviewers: felipealmeida, YOhoho, brunobelo Reviewed By: brunobelo Subscribers: cedric, #reviewers, segfaultxavi, #committers Tags: #efl Maniphest Tasks: T8418 Differential Revision: https://phab.enlightenment.org/D10694
Diffstat (limited to 'src/tests/efl_mono/Eo.cs')
-rw-r--r--src/tests/efl_mono/Eo.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs
index 9a52085902..fc3c0d4c86 100644
--- a/src/tests/efl_mono/Eo.cs
+++ b/src/tests/efl_mono/Eo.cs
@@ -675,4 +675,40 @@ class TestHiddenClasses
675 } 675 }
676} 676}
677 677
678class TestAliasEquality
679{
680 static Dummy.MyInt a = 4;
681 static Dummy.MyInt b = 4;
682 static Dummy.MyInt c = 5;
683
684 public static void test_equals()
685 {
686 Test.AssertEquals(a, b);
687 Test.AssertNotEquals(a, c);
688 }
689
690 public static void test_equals_different_types()
691 {
692 Test.Assert(!(a.Equals(new Object())));
693 }
694
695 public static void test_equatable()
696 {
697 Test.Assert(((IEquatable<Dummy.MyInt>)a).Equals(b));
698 Test.Assert(!((IEquatable<Dummy.MyInt>)a).Equals(c));
699 }
700
701 public static void test_equality_operators()
702 {
703 Test.Assert(a == b);
704 Test.Assert(a != c);
705 }
706
707 public static void test_hash_code()
708 {
709 Test.AssertEquals(a.GetHashCode(), b.GetHashCode());
710 Test.AssertNotEquals(a.GetHashCode(), c.GetHashCode());
711 }
712}
713
678} 714}