[folks] Add basic equality testing for FieldDetails.



commit 136ae0924b2605580342b60087b2c124819d15a8
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Tue Jul 12 11:17:12 2011 -0700

    Add basic equality testing for FieldDetails.
    
    Helps: bgo#653679 - Change PostalAddressDetails.postal_addresses to
    support vCard-like arbitrary parameters

 tests/folks/field-details.vala |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/tests/folks/field-details.vala b/tests/folks/field-details.vala
index 2275e6b..37e9aac 100644
--- a/tests/folks/field-details.vala
+++ b/tests/folks/field-details.vala
@@ -26,6 +26,7 @@ public class FieldDetailsTests : Folks.TestCase
     {
       base ("FieldDetails");
       this.add_test ("parameter replacement", this.test_param_replacement);
+      this.add_test ("simple equality", this.test_simple_equality);
     }
 
   public override void set_up ()
@@ -86,6 +87,19 @@ public class FieldDetailsTests : Folks.TestCase
       foreach (var val in values_2)
           assert (values.contains (val));
     }
+
+  public void test_simple_equality ()
+    {
+      FieldDetails details_a_1 = new FieldDetails ("foo");
+      FieldDetails details_a_2 = new FieldDetails ("foo");
+      FieldDetails details_b_1 = new FieldDetails ("bar");
+
+      /* Very-basic comparisons */
+      assert (details_a_1.equal (details_a_2));
+      assert (!details_a_1.equal (details_b_1));
+      assert (!details_b_1.equal (details_a_1));
+      assert (!details_b_1.equal (details_a_2));
+    }
 }
 
 public int main (string[] args)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]