Esempio n. 1
0
        public void ResetStaticSegment_Successful()
        {
            MailChimpManager           mc       = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult                 lists    = mc.GetLists();
            List <StaticSegmentResult> segments = mc.GetStaticSegmentsForList(lists.Data[1].Id);
            StaticSegmentActionResult  result   = mc.ResetStaticSegment(lists.Data[1].Id, segments[0].StaticSegmentId);

            Assert.IsTrue(result.Complete);
        }
Esempio n. 2
0
        public void GetStaticSegmentsForList_Successful()
        {
            // Arrange
            MailChimpManager mc    = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult       lists = mc.GetLists();
            // Act
            List <StaticSegmentResult> result = mc.GetStaticSegmentsForList(lists.Data[1].Id);

            // Assert
            Assert.IsTrue(result.Count > 0);
        }
Esempio n. 3
0
 private bool ValidateUserCredentials(ChimpUserListDTO token, out string error)
 {
     error = string.Empty;
     try
     {
         var mc = new MailChimpManager(token.ApiKey);
         mc.GetStaticSegmentsForList(token.Uid); // throws if no such list
     }
     catch (Exception e)
     {
         error = FormatError(e);
         return(false);
     }
     return(true);
 }
Esempio n. 4
0
        public void AddStaticSegmentMembers_Successful()
        {
            MailChimpManager           mc       = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult                 lists    = mc.GetLists();
            List <StaticSegmentResult> segments = mc.GetStaticSegmentsForList(lists.Data[1].Id);
            EmailParameter             email1   = new EmailParameter()
            {
                Email = "*****@*****.**"
            };
            List <EmailParameter> emails = new List <EmailParameter>();

            emails.Add(email1);
            StaticSegmentMembersAddResult result = mc.AddStaticSegmentMembers(lists.Data[1].Id, segments[0].StaticSegmentId, emails);

            Assert.IsTrue(result.successCount == 1);
        }
Esempio n. 5
0
 public void ResetStaticSegment_Successful()
 {
     MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
     ListResult lists = mc.GetLists();
     List<StaticSegmentResult> segments = mc.GetStaticSegmentsForList(lists.Data[1].Id);
     StaticSegmentActionResult result = mc.ResetStaticSegment(lists.Data[1].Id, segments[0].StaticSegmentId);
     Assert.IsTrue(result.Complete);
 }
Esempio n. 6
0
 public void DeleteStaticSegmentMembers_Successful()
 {
     MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
     ListResult lists = mc.GetLists();
     List<StaticSegmentResult> segments = mc.GetStaticSegmentsForList(lists.Data[1].Id);
     EmailParameter email1 = new EmailParameter()
     {
         Email = "*****@*****.**"
     };
     List<EmailParameter> emails = new List<EmailParameter>();
     emails.Add(email1);
     StaticSegmentMembersDeleteResult result = mc.DeleteStaticSegmentMembers(lists.Data[1].Id, segments[0].StaticSegmentId, emails);
     Assert.IsTrue(result.successCount == 1);
     Assert.IsTrue(result.errorCount == 0);
 }
Esempio n. 7
0
 public void GetStaticSegmentsForList_Successful()
 {
     // Arrange 
     MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
     ListResult lists = mc.GetLists();
     // Act
     List<StaticSegmentResult> result = mc.GetStaticSegmentsForList(lists.Data[1].Id);
     // Assert
     Assert.IsTrue(result.Count > 0);
 }