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


C# MailChimpManager.DeleteMergeVar方法代码示例

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


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

示例1: SetMergeVar_Successful

        public void SetMergeVar_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists();
            // we don't want to have an existing merge var interfere
            try { mc.DeleteMergeVar(lists.Data.First().Id, "TESTSET"); }
            catch { }
            mc.AddMergeVar(lists.Data.First().Id, "TESTSET", "Test Value");

            // Act
            CompleteResult result = mc.SetMergeVar(lists.Data.First().Id, "TESTSET", "Set");

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Complete);


            // Clean up
            mc.DeleteMergeVar(lists.Data.First().Id, "TESTSET");
        }
开发者ID:CaudronThomas,项目名称:MailChimp.NET,代码行数:21,代码来源:ListTests.cs

示例2: DeleteMergeVar_Successful

        public void DeleteMergeVar_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists();

            mc.AddMergeVar(lists.Data.First().Id, "TESTDELETE", "Test Value");

            // Act
            CompleteResult result = mc.DeleteMergeVar(lists.Data.First().Id, "TESTDELETE");

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Complete);
        }
开发者ID:CaudronThomas,项目名称:MailChimp.NET,代码行数:15,代码来源:ListTests.cs

示例3: GetMergeVars_Successful

        public void GetMergeVars_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists();
            // we don't want to have an existing merge var interfere
            try { mc.DeleteMergeVar(lists.Data.First().Id, "TESTGETVAR"); } 
            catch { }
            MergeVarOptions options = new MergeVarOptions()
            {
                FieldType = "url",
                HelpText = "A url, such as https://github.com/danesparza/MailChimp.NET"
            };
            mc.AddMergeVar(lists.Data.First().Id, "TESTGETVAR", "Test Value", options);

            // Act
            MergeVarResult result = mc.GetMergeVars(lists.Data.Select(l => l.Id));

            // Assert
            Assert.IsNotNull(result.Data);
            Assert.IsTrue(result.Data.Any(d => d.MergeVars.Any(m => m.Tag == "TESTGETVAR")));

            // Clean up
            mc.DeleteMergeVar(lists.Data.First().Id, "TESTGETVAR");
        }
开发者ID:CaudronThomas,项目名称:MailChimp.NET,代码行数:25,代码来源:ListTests.cs

示例4: UpdateMergeVar_Successful

        public void UpdateMergeVar_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists();
            MergeVarOptions options = new MergeVarOptions()
            {
                FieldType = "url",
                HelpText = "A url, such as https://github.com/danesparza/MailChimp.NET"
            };
            // we don't want to have existing merge vars interfere
            try { mc.DeleteMergeVar(lists.Data.First().Id, "TESTUPDVAR"); }
            catch { }
            try { mc.DeleteMergeVar(lists.Data.First().Id, "UPDATEDVAR"); }
            catch { }
            mc.AddMergeVar(lists.Data.First().Id, "TESTUPDVAR", "Test Value", options);

            // Act
            options = new MergeVarOptions()
            {
                Tag = "UPDATEDVAR",
                HelpText = "Any url you like"
            };
            MergeVarItemResult result = mc.UpdateMergeVar(lists.Data.First().Id, "TESTUPDVAR", options);

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Tag == "UPDATEDVAR");

            // Clean up
            mc.DeleteMergeVar(lists.Data.First().Id, "UPDATEDVAR");
        }
开发者ID:CaudronThomas,项目名称:MailChimp.NET,代码行数:32,代码来源:ListTests.cs

示例5: DeleteMergeVar_Successful

        public void DeleteMergeVar_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists();

            // Act
            MergeVarDeleteResult result = mc.DeleteMergeVar(lists.Data.First().Id, "TESTVALUE");

            // Assert
            Assert.IsNotNull(result);
        }
开发者ID:paulandrewcampbell,项目名称:MailChimp.NET,代码行数:12,代码来源:ListTests.cs


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