Пример #1
0
        public void AddSegment_Successful()
        {
            // Arrange
            MailChimpManager          mc      = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult                lists   = mc.GetLists();
            AddCampaignSegmentOptions options = new AddCampaignSegmentOptions
            {
                Name           = "My Saved Segment",
                SegmentType    = "saved",
                SegmentOptions = new CampaignSegmentOptions
                {
                    Match      = "all",
                    Conditions = new List <CampaignSegmentCriteria>
                    {
                        new CampaignSegmentCriteria
                        {
                            Field    = "EMAIL",
                            Operator = "ends",
                            Value    = ".com",
                        }
                    }
                }
            };
            // Act
            SegmentAddResult result = mc.AddSegment(lists.Data[1].Id, options);

            // Assert
            Assert.IsNotNull(result.NewSegmentID);
        }
Пример #2
0
 public void AddSegment_Successful()
 {
     // Arrange 
     MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
     ListResult lists = mc.GetLists();
     AddCampaignSegmentOptions options = new AddCampaignSegmentOptions
     {
         Name = "My Saved Segment",
         SegmentType = "saved",
         SegmentOptions = new CampaignSegmentOptions
         {
             Match = "all",
             Conditions = new List<CampaignSegmentCriteria>
             {
                 new CampaignSegmentCriteria
                 {
                     Field = "EMAIL",
                     Operator = "ends",
                     Value = ".com",
                 }
             }
         }
     };
     // Act
     SegmentAddResult result = mc.AddSegment(lists.Data[1].Id, options);
     // Assert
     Assert.IsNotNull(result.NewSegmentID);
 }