Add test for RoleFieldDetails.
authorTravis Reitter <travis.reitter@collabora.co.uk>
Wed, 19 Oct 2011 22:30:40 +0000 (15:30 -0700)
committerTravis Reitter <travis.reitter@collabora.co.uk>
Mon, 24 Oct 2011 18:34:16 +0000 (11:34 -0700)
Helps: bgo#662433 - AbstractFieldDetails.equal() is ambiguous about
checking parameters.

tests/folks/abstract-field-details.vala

index ed3cdd4..6d4ef72 100644 (file)
@@ -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)