summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Reitter <travis.reitter@collabora.co.uk>2011-10-19 22:30:40 (GMT)
committerTravis Reitter <travis.reitter@collabora.co.uk>2011-10-24 18:34:16 (GMT)
commit544e02ff34ec5f40dc5dadabb2ebd16177bca67b (patch)
tree24caac270ee0e82b356b8ae179afe2d49657381f
parent91ea24e24ce8a8a135ccee3ef9355b0f997b0a72 (diff)
downloadfolks-544e02ff34ec5f40dc5dadabb2ebd16177bca67b.tar.gz
folks-544e02ff34ec5f40dc5dadabb2ebd16177bca67b.tar.xz
Add test for RoleFieldDetails.
Helps: bgo#662433 - AbstractFieldDetails.equal() is ambiguous about checking parameters.
-rw-r--r--tests/folks/abstract-field-details.vala16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/folks/abstract-field-details.vala b/tests/folks/abstract-field-details.vala
index ed3cdd4..6d4ef72 100644
--- a/tests/folks/abstract-field-details.vala
+++ b/tests/folks/abstract-field-details.vala
@@ -30,6 +30,8 @@ public class EmailFieldDetailsTests : Folks.TestCase
this.add_test ("parameter equality", this.test_params_equality);
this.add_test ("ImFieldDetails equality",
this.test_im_field_details_equality);
+ this.add_test ("RoleFieldDetails equality",
+ this.test_role_field_details_equality);
}
public override void set_up ()
@@ -165,6 +167,20 @@ public class EmailFieldDetailsTests : Folks.TestCase
EmailFieldDetails details_c_1 = new EmailFieldDetails ("foo@example.org");
assert (!details_a_1.equal (details_c_1));
}
+
+ public void test_role_field_details_equality ()
+ {
+ RoleFieldDetails details_a_1 = new RoleFieldDetails (
+ new Role ("Captain", "Obvious Corp.", null));
+ RoleFieldDetails details_a_2 = new RoleFieldDetails (
+ new Role ("Captain", "Obvious Corp.", null));
+ RoleFieldDetails details_b_1 = new RoleFieldDetails (
+ new Role ("Flunkie", "Obvious Corp.", null));
+
+ /* Very-basic comparisons */
+ assert (details_a_1.equal (details_a_2));
+ assert (!details_a_1.equal (details_b_1));
+ }
}
public int main (string[] args)