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

            var contactList = new ContactList
                {
                Name = string.Format("List {0}", Guid.NewGuid()),
                Status = Status.Active
            };

            var result = cc.AddList(contactList);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Name.Equals(contactList.Name));

            result.Name = string.Format("List - {0}", Guid.NewGuid());

            var updatedList = cc.UpdateList(result);
            Assert.IsNotNull(updatedList);
            Assert.AreEqual(result.Id, updatedList.Id);
            Assert.AreEqual(result.Name, updatedList.Name);
        }
Пример #2
0
        public void LiveDeleteContactListTest()
        {
            var cc = new ConstantContact(ApiKey, AccessToken);

            var contactList = new ContactList
            {
                Name = string.Format("List {0}", Guid.NewGuid()),
                Status = Status.Active
            };

            var result = cc.AddList(contactList);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Name.Equals(contactList.Name));

            result.Name = string.Format("List - {0}", Guid.NewGuid());

            var deleted = cc.DeleteList(result.Id.ToString(CultureInfo.InvariantCulture));
            Assert.IsTrue(deleted);
        }
Пример #3
0
        public void LiveAddContactListTest()
        {
            var cc = new ConstantContact(ApiKey, AccessToken);

            ContactList contactList = new ContactList { 
                Name = string.Format("List {0}", Guid.NewGuid()),
                Status = Status.Active
            };

            var result = cc.AddList(contactList);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Name.Equals(contactList.Name));
        }