[folks] Add assertions about Telepathy writeable properties to our tests.



commit 8520eba7a8a7f95fba72f097988ced0b6ab1a0c9
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Thu Oct 6 09:54:54 2011 -0700

    Add assertions about Telepathy writeable properties to our tests.

 tests/telepathy/individual-properties.vala |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/tests/telepathy/individual-properties.vala b/tests/telepathy/individual-properties.vala
index b56245b..d37b264 100644
--- a/tests/telepathy/individual-properties.vala
+++ b/tests/telepathy/individual-properties.vala
@@ -98,6 +98,25 @@ public class IndividualPropertiesTests : Folks.TestCase
               assert (i.groups.contains ("Montreal") == true);
               assert (i.groups.contains ("Francophones") == true);
 
+              /* Check writeability of fields */
+              Tpf.Persona tpf_persona = null;
+              foreach (var p in i.personas)
+                {
+                  if (p is Tpf.Persona)
+                    {
+                      tpf_persona = p as Tpf.Persona;
+                      break;
+                    }
+                }
+              assert (tpf_persona != null);
+              assert ("alias" in tpf_persona.writeable_properties);
+              assert ("is-favourite" in tpf_persona.writeable_properties);
+              assert ("groups" in tpf_persona.writeable_properties);
+              /* These are only writeable for the user contact */
+              assert (!tpf_persona.is_user);
+              assert (!("full-name" in tpf_persona.writeable_properties));
+              assert (!("phone-numbers" in tpf_persona.writeable_properties));
+
               /* Check ContactInfo-provided properties */
               assert (new PhoneFieldDetails ("+15142345678")
                   in i.phone_numbers);



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