public async Task ContactClient_can_get_contact() { const int contactId = 3234574; var options = new ContactGetRequestOptions { PropertiesToInclude = new List <string> { "my_custom_property" }, FormSubmissionMode = ContactFormSubmissionMode.Newest, IncludeHistory = false, IncludeListMemberships = false }; var data = await _client.GetByIdAsync <ContactHubSpotEntity>(contactId, options); Assert.NotNull(data); Assert.Equal("Codey", data.FirstName); Assert.Equal("Huang", data.Lastname); Assert.Equal(contactId, data.Id); }
public async Task ContactClient_can_get_contact_by_email() { const string email = "*****@*****.**"; var options = new ContactGetRequestOptions { PropertiesToInclude = new List <string> { "my_custom_property", "hs_object_id" }, FormSubmissionMode = ContactFormSubmissionMode.Newest, IncludeHistory = false, IncludeListMemberships = false }; var data = await _client.GetByEmailAsync <ContactHubSpotEntity>(email, options); Assert.NotNull(data); Assert.Equal("Codey", data.FirstName); Assert.Equal("Huang", data.Lastname); Assert.Equal(email, data.Email); }