public void FixtureSetup()
        {
            Client = new RestContactClient(MockClient.User(), MockClient.Password());

            ContactId         = 165251012001;
            ContactListId     = 188505001;
            QueryContact      = new CfQueryContacts(1000, 0, null, null, null);
            GetContactHistory = new CfGetContactHistory(1000, 0, ContactId);
            var contact1 = new CfContact(null, "Contact1_Name", "Contact1_LastName", null, "14252163710", null, null, null, null, null);
            var contact2 = new CfContact(null, "Contact2_Name", "Contact2_LastName", null, "14252163710", null, null, null, null, null);

            CfContact[] contacts = { contact1, contact2 };
            CreateContactList = new CfCreateContactList(null, "NewContactListTest", false, new CfContactSource(contacts));

            object[] contacts2 = { ContactId };
            CreateContactList2 = new CfCreateContactList(null, "NewContactListTest", false, new CfContactSource(contacts2));

            var contactNumbers = new CfContactSourceNumbers("14252163710", new[] { "homePhone" });

            CfContactSourceNumbers[] contacts3 = { contactNumbers };
            CreateContactList3 = new CfCreateContactList(null, "NewContactListTest3", false, new CfContactSource(contacts3));

            QueryContactLists = new CfQuery();

            const long contactId     = 165332795001;
            const long contactListId = 188518001;

            object[] contact = { contactId };
            AddContactsToList = new CfContactListRequest(contactListId, false, new CfContactSource(contact));

            RemoveContactsFromList = new CfRemoveContactsFromList(contactListId, contactId);

            ContactLastName  = "ContactLastNameRest";
            ContactFirstName = "ContactFirstNameRest";
        }
        public void Test_RemoveContactsFromListComplete()
        {
            const int clientListId = 192950001;

            object[] contacts           = { 169299452001 };
            var      contactListRequest = new CfContactListRequest
            {
                ContactListId = clientListId,
                ContactSource = new CfContactSource
                {
                    Items = contacts
                }
            };

            Client.AddContactsToList(contactListRequest);

            object contact = 169299452001;
            var    removeContactsFromList = new CfRemoveContactsFromList
            {
                ContactListId = clientListId,
                Item          = contact
            };

            Client.RemoveContactsFromList(removeContactsFromList);
        }
Exemple #3
0
 public void AddContactsToList(CfContactListRequest addContactsToList)
 {
     if (addContactsToList == null)
     {
         return;
     }
     BaseRequest <string>(HttpMethod.Post, new ContactListRequest(addContactsToList),
                          new CallfireRestRoute <Contact>(addContactsToList.ContactListId, ContactRestRouteObjects.List, ContactRestRouteObjects.Add));
 }
        public void Test_AddContactsToListMandatory()
        {
            object[] contacts           = { 169299452001 };
            var      contactListRequest = new CfContactListRequest
            {
                ContactListId = 192950001,
                ContactSource = new CfContactSource
                {
                    Items = contacts
                }
            };

            Client.AddContactsToList(contactListRequest);
        }
        public void Test_AddContactsToListComplete()
        {
            var contact1 = new CfContact
            {
                FirstName = "FirstNameContact",
                HomePhone = "14252163710"
            };

            object[] contacts           = { contact1 };
            var      contactListRequest = new CfContactListRequest
            {
                Validate      = true,
                ContactListId = 192950001,
                ContactSource = new CfContactSource
                {
                    Items = contacts
                }
            };

            Client.AddContactsToList(contactListRequest);
        }
 public void AddContactsToList(CfContactListRequest addContactsToList)
 {
     ContactService.AddContactsToList(new ContactListRequest(addContactsToList));
 }
 public ContactListRequest(CfContactListRequest source)
 {
     ContactListId = source.ContactListId;
     Validate      = source.Validate;
     ContactSource = ContactSourceMapper.ToContactSource(source.ContactSource);
 }