public void TheBigTest()
        {
            string emailToTestWith = "*****@*****.**";

            Upac.CampaignMonitor.Api api = new Upac.CampaignMonitor.Api();
            List<List> lists = api.GetLists();

            Assert.GreaterOrEqual(lists.Count, 2);

            foreach (List list in lists)
            {
                Console.WriteLine("Adding {0} to list {1}", emailToTestWith, list.ListID);
                bool added = api.AddSubscriber(emailToTestWith, string.Empty, list.ListID);
                Assert.IsTrue(added);
            }

            List<string> subscriberLists = api.GetListsFromSubscriber(emailToTestWith);
            Assert.AreEqual(lists.Count, subscriberLists.Count);

            bool isSubscribed = api.IsSubscribed(emailToTestWith, lists[0].ListID);
            Assert.IsTrue(isSubscribed);

            api.RemoveSubscriberFromList(emailToTestWith, lists[0].ListID);
            subscriberLists = api.GetListsFromSubscriber(emailToTestWith);
            Assert.AreEqual(lists.Count - 1, subscriberLists.Count);

            isSubscribed = api.IsSubscribed(emailToTestWith, lists[1].ListID);
            Assert.IsTrue(isSubscribed);
        }
示例#2
0
        public void TheBigTest()
        {
            string emailToTestWith = "*****@*****.**";

            Upac.CampaignMonitor.Api api = new Upac.CampaignMonitor.Api();
            List <List> lists            = api.GetLists();

            Assert.GreaterOrEqual(lists.Count, 2);

            foreach (List list in lists)
            {
                Console.WriteLine("Adding {0} to list {1}", emailToTestWith, list.ListID);
                bool added = api.AddSubscriber(emailToTestWith, string.Empty, list.ListID);
                Assert.IsTrue(added);
            }

            List <string> subscriberLists = api.GetListsFromSubscriber(emailToTestWith);

            Assert.AreEqual(lists.Count, subscriberLists.Count);

            bool isSubscribed = api.IsSubscribed(emailToTestWith, lists[0].ListID);

            Assert.IsTrue(isSubscribed);

            api.RemoveSubscriberFromList(emailToTestWith, lists[0].ListID);
            subscriberLists = api.GetListsFromSubscriber(emailToTestWith);
            Assert.AreEqual(lists.Count - 1, subscriberLists.Count);

            isSubscribed = api.IsSubscribed(emailToTestWith, lists[1].ListID);
            Assert.IsTrue(isSubscribed);
        }
 public void TestGetLists()
 {
     Upac.CampaignMonitor.Api api = new Upac.CampaignMonitor.Api();
     List<List> lists = api.GetLists();
     foreach (List list in lists)
     {
         Console.WriteLine("List id: {0}, list name: {1}", list.ListID, list.Name);
     }
 }
示例#4
0
        public void TestGetLists()
        {
            Upac.CampaignMonitor.Api api = new Upac.CampaignMonitor.Api();
            List <List> lists            = api.GetLists();

            foreach (List list in lists)
            {
                Console.WriteLine("List id: {0}, list name: {1}", list.ListID, list.Name);
            }
        }
        public void TestAddSubscriberAndRemoveSubscriberFromList()
        {
            // First add
            Upac.CampaignMonitor.Api api = new Upac.CampaignMonitor.Api();
            List<List> lists = api.GetLists();
            foreach (List list in lists)
            {
                Console.WriteLine("Adding {0} to list {1}", "*****@*****.**", list.ListID);
                bool added = api.AddSubscriber("*****@*****.**", "Christian Palm", list.ListID);
                Assert.IsTrue(added);
            }

            // Then remove
            foreach (List list in lists)
            {
                Console.WriteLine("Removing {0} from list {1}", "*****@*****.**", list.ListID);
                bool removed = api.RemoveSubscriberFromList("*****@*****.**", list.ListID);
                Assert.IsTrue(removed);
            }
        }
示例#6
0
        public void TestAddSubscriberAndRemoveSubscriberFromList()
        {
            // First add
            Upac.CampaignMonitor.Api api = new Upac.CampaignMonitor.Api();
            List <List> lists            = api.GetLists();

            foreach (List list in lists)
            {
                Console.WriteLine("Adding {0} to list {1}", "*****@*****.**", list.ListID);
                bool added = api.AddSubscriber("*****@*****.**", "Christian Palm", list.ListID);
                Assert.IsTrue(added);
            }

            // Then remove
            foreach (List list in lists)
            {
                Console.WriteLine("Removing {0} from list {1}", "*****@*****.**", list.ListID);
                bool removed = api.RemoveSubscriberFromList("*****@*****.**", list.ListID);
                Assert.IsTrue(removed);
            }
        }