Пример #1
0
        public void LiveGetContactByEmail()
        {
            var cc = new ConstantContact(ApiKey, AccessToken);

            var contact = new Contact();
            contact.EmailAddresses.Add(new EmailAddress { EmailAddr = String.Format("{0}@email.com", Guid.NewGuid()), ConfirmStatus = ConfirmStatus.NoConfirmationRequired, Status = Status.Active });
            contact.Lists.Add(new ContactList { Id = "1", Status = Status.Active });

            Contact nc = cc.AddContact(contact, false);
            Assert.IsNotNull(nc);
            Assert.IsNotNull(nc.Id);

            var result = cc.GetContacts(nc.EmailAddresses[0].EmailAddr, 1, DateTime.Now.AddMonths(-1));
            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Results);
            Assert.AreEqual(1, result.Results.Count);
        }
Пример #2
0
        public void LiveGetAllContacts()
        {
            var cc = new ConstantContact(ApiKey, AccessToken);

            var result = cc.GetContacts(DateTime.Now.AddMonths(-1));
            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Results);
            Assert.AreNotEqual(0, result.Results.Count);
        }
Пример #3
0
        public void LiveContactTrackingUnsubscribesTest()
        {
            var cc = new ConstantContact(ApiKey, AccessToken);

            ResultSet<Contact> contacts = cc.GetContacts(DateTime.Now.AddMonths(-1));
            Assert.IsNotNull(contacts);
            Assert.IsNotNull(contacts.Results);
            Assert.IsTrue(contacts.Results.Count > 0);

            ResultSet<OptOutActivity> a = cc.GetContactTrackingOptOuts(contacts.Results[0].Id, DateTime.Now.AddMonths(-1));
            Assert.IsNotNull(a);
        } 
Пример #4
0
        public void LiveContactTrackingForwardsTest()
        {
            var cc = new ConstantContact(ApiKey, AccessToken);

            ResultSet<Contact> contacts = cc.GetContacts(DateTime.Now.AddMonths(-1));
            Assert.IsNotNull(contacts);
            Assert.IsNotNull(contacts.Results);
            Assert.IsTrue(contacts.Results.Count > 0);

            ResultSet<ForwardActivity> fa = cc.GetContactTrackingForwards(contacts.Results[0].Id, DateTime.Now.AddMonths(-1));
            Assert.IsNotNull(fa);
        }
Пример #5
0
        public void LiveContactTrackingSummaryTest()
        {
            var cc = new ConstantContact(ApiKey, AccessToken);

            ResultSet<Contact> contacts = cc.GetContacts(DateTime.Now.AddMonths(-1));
            Assert.IsNotNull(contacts);
            Assert.IsNotNull(contacts.Results);
            Assert.IsTrue(contacts.Results.Count > 0);

            TrackingSummary summary = cc.GetContactTrackingSummary(contacts.Results[0].Id);
            Assert.IsNotNull(summary);
            //Assert.AreNotEqual(0, summary.Forwards);
            //Assert.AreNotEqual(0, summary.Opens);
            //Assert.AreNotEqual(0, summary.Sends);

            IList<EmailCampaign> camps = cc.GetCampaigns(DateTime.Now.AddMonths(-1));
            summary = cc.GetCampaignTrackingSummary(camps[1].Id);
            //Assert.AreNotEqual(0, summary.Forwards);
            //Assert.AreNotEqual(0, summary.Opens);
            //Assert.AreNotEqual(0, summary.Sends);
            //Assert.AreNotEqual(0, summary.Bounces);
        }
Пример #6
0
		public void LiveContactTrackingEmailCampaignActivitiesTest()
		{
			var cc = new ConstantContact(ApiKey, AccessToken);

			ResultSet<Contact> contacts = cc.GetContacts(DateTime.Now.AddMonths(-1));
            Assert.IsNotNull(contacts);
            Assert.IsNotNull(contacts.Results);
            Assert.IsTrue(contacts.Results.Count > 0);

			ResultSet<TrackingSummary> result = cc.GetContactTrackingEmailCampaignActivities(contacts.Results[0].Id);
			Assert.IsNotNull(result);
		}