当前位置: 首页>>代码示例>>C#>>正文


C# MailChimpManager.GetListInterestGroupings方法代码示例

本文整理汇总了C#中MailChimpManager.GetListInterestGroupings方法的典型用法代码示例。如果您正苦于以下问题:C# MailChimpManager.GetListInterestGroupings方法的具体用法?C# MailChimpManager.GetListInterestGroupings怎么用?C# MailChimpManager.GetListInterestGroupings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MailChimpManager的用法示例。


在下文中一共展示了MailChimpManager.GetListInterestGroupings方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetListInterestGroupings_Successful

        public void GetListInterestGroupings_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager("efb48a02f2f56120e2f3f6e2fef71803-us6");
            ListResult lists = mc.GetLists(new ListFilter(){ListName = "TestAPIGetInterestGroup"});
            Assert.IsNotNull(lists);
            Assert.IsTrue(lists.Data.Any());
            //  Act
            List<InterestGrouping> results = mc.GetListInterestGroupings(lists.Data.FirstOrDefault().Id);

            //  Assert
            Assert.IsNotNull(results);
            Assert.IsTrue(results.Any());
        }
开发者ID:RomeoQNgo,项目名称:MailChimp.NET,代码行数:14,代码来源:ListTests.cs

示例2: GetListInterestGroupings_Successful

        public void GetListInterestGroupings_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists(new ListFilter(){ListName = "TestAPIGetInterestGroup"});
            Assert.IsNotNull(lists);
            Assert.IsTrue(lists.Data.Any());
            //  Act
            List<InterestGrouping> results = mc.GetListInterestGroupings(lists.Data.FirstOrDefault().Id);

            //  Assert
            Assert.IsNotNull(results);
            Assert.IsTrue(results.Any());
        }
开发者ID:konstrui,项目名称:MailChimp.NET,代码行数:14,代码来源:ListTests.cs

示例3: SubscribeWithGroupSelection_Successful

        public void SubscribeWithGroupSelection_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists();
            EmailParameter email = new EmailParameter()
            {
                Email = "[email protected]"
            };

            // find a list with interest groups...
            string strListID = null;
            int nGroupingID = 0;
            string strGroupName = null;
            foreach (ListInfo li in lists.Data) {
                List<InterestGrouping> interests = mc.GetListInterestGroupings(li.Id);
                if (interests != null) {
                    if (interests.Count > 0) {
                        if (interests[0].GroupNames.Count > 0) {
                            strListID = li.Id;
                            nGroupingID = interests[0].Id;
                            strGroupName = interests[0].GroupNames[0].Name;
                            break;
                        }
                    }
                }
            }
            Assert.IsNotNull(strListID,"no lists found in this account with groupings / group names");
            Assert.AreNotEqual(0,nGroupingID);
            Assert.IsNotNull(strGroupName);

            MyMergeVar mvso = new MyMergeVar();
            mvso.Groupings = new List<Grouping>();
            mvso.Groupings.Add(new Grouping());
            mvso.Groupings[0].Id = nGroupingID;
            mvso.Groupings[0].GroupNames = new List<string>();
            mvso.Groupings[0].GroupNames.Add(strGroupName);
            mvso.FirstName = "Testy";
            mvso.LastName = "Testerson";

            //  Act
            EmailParameter results = mc.Subscribe(strListID, email, mvso);

            //  Assert
            Assert.IsNotNull(results);
            Assert.IsTrue(!string.IsNullOrEmpty(results.LEId));
        }
开发者ID:CaudronThomas,项目名称:MailChimp.NET,代码行数:47,代码来源:ListTests.cs

示例4: SubscribeWithGroupSelectionUsingDictonary_Successful

				public void SubscribeWithGroupSelectionUsingDictonary_Successful() {
					//  Arrange
					MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
					ListResult lists = mc.GetLists();
					EmailParameter email = new EmailParameter() {
						Email = "[email protected]"
					};

					// find a list with interest groups...
					string strListID = null;
					int nGroupingID = 0;
					string strGroupName = null;
					foreach (ListInfo li in lists.Data) {
						List<InterestGrouping> interests = mc.GetListInterestGroupings(li.Id);
						if (interests != null) {
							if (interests.Count > 0) {
								if (interests[0].GroupNames.Count > 0) {
									strListID = li.Id;
									nGroupingID = interests[0].Id;
									strGroupName = interests[0].GroupNames[0].Name;
									break;
								}
							}
						}
					}
					Assert.IsNotNull(strListID, "no lists found in this account with groupings / group names");
					Assert.AreNotEqual(0, nGroupingID);
					Assert.IsNotNull(strGroupName);

					MergeVar mvso = new MergeVar();
					mvso.Groupings = new List<Grouping>();
					mvso.Groupings.Add(new Grouping());
					mvso.Groupings[0].Id = nGroupingID;
					mvso.Groupings[0].GroupNames = new List<string>();
					mvso.Groupings[0].GroupNames.Add(strGroupName);
					mvso.Add("FNAME","Testy" + DateTime.Now);
					mvso.Add("LNAME", "Testerson" + DateTime.Now);

					//  Act
					EmailParameter results = mc.Subscribe(strListID, email, mvso);

					//  Assert
					Assert.IsNotNull(results);
					Assert.IsTrue(!string.IsNullOrEmpty(results.LEId));

					// load
					List<EmailParameter> emails = new List<EmailParameter>();
					emails.Add(results);
					MemberInfoResult memberInfos = mc.GetMemberInfo(strListID, emails);

					// Assert
					Assert.AreEqual(1, memberInfos.SuccessCount);
					Assert.AreEqual(2, memberInfos.Data[0].MemberMergeInfo.Count);
					Assert.AreEqual(mvso["FNAME"], memberInfos.Data[0].MemberMergeInfo["FNAME"]);
					Assert.AreEqual(mvso["LNAME"], memberInfos.Data[0].MemberMergeInfo["LNAME"]);

				}
开发者ID:erpframework,项目名称:MailChimp.NET,代码行数:57,代码来源:ListTests.cs


注:本文中的MailChimpManager.GetListInterestGroupings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。