예제 #1
0
        public void LiveGetContactTest()
        {
            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 retrievedContact = cc.GetContact(nc.Id);

            Assert.IsNotNull(retrievedContact);
            Assert.AreEqual(retrievedContact.Id, nc.Id);
        }