public MockEmptyConversation(string phoneNumberValue)
        {
            AssociatedContacts = new ContactList();

            Contact contact = new Contact(Contact.UnknownContactId, null, null, null, new PhoneNumber(phoneNumberValue));

            AssociatedContacts.Add(contact);
        }
        public MockEmptyConversation(string firstName, string middleName, string lastName, string phoneNumberValue)
        {
            PhoneNumber phoneNumber = new PhoneNumber(phoneNumberValue);

            AssociatedContacts = new ContactList();
            Contact contact = new MockContact(firstName, middleName, lastName, phoneNumber);

            AssociatedContacts.Add(contact);
        }
Example #3
0
 private void HashByContactId(Dictionary <long, IContactList> hashByContactId, IContactList contactList)
 {
     foreach (IContact contact in contactList)
     {
         IContactList hashedContactList;
         if (hashByContactId.ContainsKey(contact.ContactId))
         {
             hashedContactList = hashByContactId[contact.ContactId];
             hashedContactList.Add(contact);
         }
         else
         {
             hashedContactList = new ContactList();
             hashedContactList.Add(contact);
             hashByContactId[contact.ContactId] = contactList;
         }
     }
 }
Example #4
0
        private ContactList CoalesceContactLists(IContactList contactListA, IContactList contactListB)
        {
            Dictionary <long, IContactList> hashByContactId = new Dictionary <long, IContactList>();

            HashByContactId(hashByContactId, contactListA);
            HashByContactId(hashByContactId, contactListB);

            ContactList mergedContacts = new ContactList();

            foreach (IContactList contactListById in hashByContactId.Values)
            {
                IContact contactMerged = contactListById[0];
                for (int contactIndex = 1; contactIndex < contactListById.Count; contactIndex++)
                {
                    IContact contactCurrent = contactListById[contactIndex];
                    contactMerged = new MergedContact(contactMerged, contactCurrent);
                }
                mergedContacts.Add(contactMerged);
            }

            return(mergedContacts);
        }