public void GetAbuseReport_Successful() { // Arrange MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey); ListResult lists = mc.GetLists(); // Act AbuseResult details = mc.GetListAbuseReports(lists.Data[0].Id); // Assert Assert.IsNotNull(details.Data); }
public static IEnumerable ListsAbuseReports(SqlString apikey, SqlString list_id) { string cListId = list_id.ToString(); MailChimpManager mc = new MailChimpManager(apikey.ToString()); AbuseResult abuseResult = mc.GetListAbuseReports(cListId, 0, 500, ""); List <AbuseReport> reports = new List <AbuseReport>(abuseResult.Total); reports.AddRange(abuseResult.Data); int page = 1; int total = abuseResult.Total; int currentTotal = abuseResult.Data.Count; while (currentTotal < total) { abuseResult = mc.GetListAbuseReports(cListId, page++, 500, ""); reports.AddRange(abuseResult.Data); currentTotal += abuseResult.Data.Count; } return(reports); }