本文整理汇总了C#中CTCT.ConstantContact.CreateAddContactsActivity方法的典型用法代码示例。如果您正苦于以下问题:C# ConstantContact.CreateAddContactsActivity方法的具体用法?C# ConstantContact.CreateAddContactsActivity怎么用?C# ConstantContact.CreateAddContactsActivity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTCT.ConstantContact
的用法示例。
在下文中一共展示了ConstantContact.CreateAddContactsActivity方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LiveActivityGetSummaryReportTest
public void LiveActivityGetSummaryReportTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var add = new AddContacts(
new List<AddContactsImportData>{
new AddContactsImportData{
EmailAddresses = new List<string>{ String.Format("{0}@example.com", Guid.NewGuid()) }
}
},
new List<string> { "1" },
null
);
Activity act = cc.CreateAddContactsActivity(add);
Assert.IsNotNull(act);
IList<Activity> list = cc.GetActivities();
foreach (Activity activity in list)
{
Activity a = cc.GetActivity(activity.Id);
Assert.IsNotNull(a);
}
}
示例2: LiveActivityClearListTest
public void LiveActivityClearListTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var emailAddresses = new List<string> { String.Format("{0}@example.com", Guid.NewGuid()) };
var lists = new List<string> { "2" };
var add = new AddContacts(
new List<AddContactsImportData>{
new AddContactsImportData{
EmailAddresses = emailAddresses
}
},
lists,
null
);
Activity act = cc.CreateAddContactsActivity(add);
Assert.IsNotNull(act);
Activity activity = cc.AddClearListsActivity(lists);
Assert.IsNotNull(activity);
Assert.AreEqual(activity.Type, "CLEAR_CONTACTS_FROM_LISTS");
}
示例3: LiveActivityAddContactTest
public void LiveActivityAddContactTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var add = new AddContacts(
new List<AddContactsImportData>{
new AddContactsImportData{
EmailAddresses = new List<string>{ String.Format("{0}@example.com", Guid.NewGuid()) }
}
},
new List<string> { "1" },
null
);
var act = cc.CreateAddContactsActivity(add);
Assert.IsNotNull(act);
}
示例4: LiveActivityRemoveContactTest
public void LiveActivityRemoveContactTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var emailAddresses = new List<string>{ String.Format("{0}@example.com", Guid.NewGuid()) };
var lists = new List<string> { "2" };
var add = new AddContacts(
new List<AddContactsImportData>{
new AddContactsImportData{
EmailAddresses = emailAddresses
}
},
lists,
null
);
Activity act = cc.CreateAddContactsActivity(add);
Assert.IsNotNull(act);
Activity activity = cc.AddRemoveContactsFromListsActivity(emailAddresses, lists);
Assert.IsNotNull(activity);
Assert.AreEqual(activity.ContactCount, emailAddresses.Count);
}
示例5: LiveActivityRemoveContactsMultipartTest
public void LiveActivityRemoveContactsMultipartTest()
{
var cc = new ConstantContact(ApiKey, AccessToken);
var filename = "remove_contacts.csv";
var fileContent = String.Format("{0}@example.com", Guid.NewGuid());
var content = Encoding.UTF8.GetBytes(fileContent);
var lists = new List<string>() { "1" };
var add = new AddContacts(
new List<AddContactsImportData>{
new AddContactsImportData{
EmailAddresses = new List<string> { fileContent }
}
},
lists,
null
);
Activity act = cc.CreateAddContactsActivity(add);
Activity activity = cc.RemoveContactsMultipartActivity(filename, content, lists);
Assert.IsNotNull(activity);
Assert.IsNotNull(activity.Id);
Assert.AreEqual(activity.ContactCount, 1);
Assert.AreEqual(activity.Type, "REMOVE_CONTACTS_FROM_LISTS");
}