Пример #1
0
        public void DeleteContentArea()
        {
            var deleteContentArea = new ETContentArea
            {
                AuthStub    = client,
                CustomerKey = contentAreaName
            };
            var response = deleteContentArea.Delete();

            Assert.AreEqual(response.Code, 200);
            Assert.GreaterOrEqual(response.Results.Length, 1);
            Assert.AreEqual(response.Results[0].StatusMessage, "Content deleted");
            var getContentArea = new ETContentArea
            {
                AuthStub     = client,
                Props        = new[] { "RowObjectID", "ObjectID", "ID", "CustomerKey", "Client.ID", "ModifiedDate", "CreatedDate", "CategoryID", "Name", "Layout", "IsDynamicContent", "Content", "IsSurvey", "IsBlank", "Key" },
                SearchFilter = new SimpleFilterPart {
                    Property = "CustomerKey", SimpleOperator = SimpleOperators.equals, Value = new[] { contentAreaName }
                },
            };
            var getResponse = getContentArea.Get();

            Assert.AreEqual(getResponse.Code, 200);
            Assert.AreEqual(getResponse.Results.Length, 0);
        }
Пример #2
0
 public void ContentAreaTearDown()
 {
     if (contentArea != null)
     {
         var contentObj = new ETContentArea();
         contentObj.ID       = contentArea.ID;
         contentObj.AuthStub = client;
         contentObj.Delete();
     }
 }