public void CampaignSegmentTest_Successful()
 {
     //  Arrange
     MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
     ListResult lists = mc.GetLists();
     CampaignSegmentOptions options = new CampaignSegmentOptions();
     options.Match= "All";
     string dateListCreated = lists.Data[1].DateCreated;
     List<CampaignSegmentCriteria> conditions = new List<CampaignSegmentCriteria>();
     conditions.Add(new CampaignSegmentCriteria { Field = "date", Operator = "eq", Value = dateListCreated });
     options.Conditions = conditions;
     string listId = lists.Data[1].Id;
     //  Act
     CampaignSegmentTestResult result = mc.CampaignSegmentTest(listId,options);          
     //  Assert
     Assert.IsTrue(result.Total == 1);
 }
        public void CampaignSavedSegmentTest_Successful()
        {
            //  Arrange
            MailChimpManager mc    = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult       lists = mc.GetLists();

            Assert.IsNotNull(lists);
            Assert.IsTrue(lists.Data.Count > 0);
            string listID = lists.Data[1].Id;
            CampaignSegmentOptions options = new CampaignSegmentOptions();

            options.SavedSegmentId = "yourSavedSegmentId";

            //  Act
            CampaignSegmentTestResult result = mc.CampaignSegmentTest(listID, options);

            //  Assert
            Assert.IsTrue(result.Total > 0);
        }
Exemple #3
0
        public void CampaignSegmentTest_Successful()
        {
            //  Arrange
            MailChimpManager       mc      = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult             lists   = mc.GetLists();
            CampaignSegmentOptions options = new CampaignSegmentOptions();

            options.Match = "All";
            string dateListCreated = lists.Data[1].DateCreated;
            List <CampaignSegmentCriteria> conditions = new List <CampaignSegmentCriteria>();

            conditions.Add(new CampaignSegmentCriteria {
                Field = "date", Operator = "eq", Value = dateListCreated
            });
            options.Conditions = conditions;
            string listId = lists.Data[1].Id;
            //  Act
            CampaignSegmentTestResult result = mc.CampaignSegmentTest(listId, options);

            //  Assert
            Assert.IsTrue(result.Total == 1);
        }
        public void CampaignSavedSegmentTest_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists();
            Assert.IsNotNull(lists);
            Assert.IsTrue(lists.Data.Count > 0);
            string listID = lists.Data[1].Id;
            CampaignSegmentOptions options = new CampaignSegmentOptions();
            options.SavedSegmentId = "yourSavedSegmentId";

            //  Act
            CampaignSegmentTestResult result = mc.CampaignSegmentTest(listID, options);
            
            //  Assert
            Assert.IsTrue(result.Total > 0);
        }