private void CreateContacts() { var helper = new ContactHelper(false); //Create contacts. _DeletedContactId = helper.AddContact().InsertedContactId; _NotDeletedContactId = helper.AddContact().InsertedContactId; //Delete only fist contact. new ContactProxy().DeleteContact(_DeletedContactId); }
public void IndexedContactShouldMatchEntityData() { var searchProxy = new SearchProxy(); var contactHelper = new ContactHelper(); var contactResponse = contactHelper.AddContact(); Thread.Sleep(2000); var contact = new ContactProxy().GetContact(contactResponse.InsertedContactId).DataObject; var searchResults = searchProxy.Search(contact.EmailAddress, SearchScope.Contacts, 1, 10); Assert.IsNotNull(searchResults.DataObject); Assert.IsTrue(searchResults.DataObject.Contacts.Count > 0); var indexedContact = searchResults.DataObject.Contacts.First(x => ReplaceEm(x.ContactEmail) == contact.EmailAddress); Assert.IsNotNull(indexedContact); Assert.AreEqual(contact.GivenName + " " + contact.FamilyName, ReplaceEm(indexedContact.Name)); Assert.AreEqual(contact.MobilePhone, indexedContact.MobilePhone); Assert.AreEqual(contact.PrimaryPhone, indexedContact.MainPhone); Assert.AreEqual(contact.Id, indexedContact.Id); Assert.AreEqual("Contact", indexedContact.EntityType); Assert.AreEqual(contact.CompanyId ?? 0, indexedContact.CompanyId); Assert.AreEqual(contact.TwitterId, indexedContact.TwitterId); }
public void IndexedContactShouldMatchEntityData() { var searchProxy = new SearchProxy(); var contactHelper = new ContactHelper(); var contactResponse = contactHelper.AddContact(); Thread.Sleep(2000); var contact = new ContactProxy().GetContact(contactResponse.InsertedContactId).DataObject; var searchResults = searchProxy.Search(contact.EmailAddress, SearchScope.Contacts, 1, 10); Assert.IsNotNull(searchResults.DataObject); Assert.IsTrue(searchResults.DataObject.Contacts.Count > 0); var indexedContact = searchResults.DataObject.Contacts.First(x => ReplaceEm(x.ContactEmail) == contact.EmailAddress); Assert.IsNotNull(indexedContact); Assert.AreEqual(contact.GivenName + " " + contact.FamilyName, ReplaceEm(indexedContact.Name)); Assert.AreEqual(contact.MobilePhone, indexedContact.MobilePhone); Assert.AreEqual(contact.PrimaryPhone, indexedContact.MainPhone); Assert.AreEqual(contact.Id, indexedContact.Id); Assert.AreEqual("Contact", indexedContact.EntityType); Assert.AreEqual(contact.CompanyId ?? 0, indexedContact.CompanyId); Assert.AreEqual(contact.TwitterId, indexedContact.TwitterId); }