Exemple #1
0
        /// <summary>
        /// can not get a category accordling to my function.
        ///otherwise ,there is an effeciency problem.
        ///so, Comment it.
        /// </summary>
        //[Test]
        public void GetAdFormatLeadsFull()
        {
            TestData.AdFormatItem = addAdFormatItem();
            ItemType item = TestData.AdFormatItem;

            Assert.IsNotNull(item);
            //
            GetAdFormatLeadsCall api = new GetAdFormatLeadsCall(this.apiContext);

            DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] {
                DetailLevelCodeType.ReturnAll
            };
            api.DetailLevelList = new DetailLevelCodeTypeCollection(detailLevels);
            string itemID = item.ItemID;
            bool   ncludeMemberMessages         = true;
            MessageStatusTypeCodeType status    = MessageStatusTypeCodeType.Unanswered;
            DateTime startCreationTime          = DateTime.Now.AddDays(-1);
            DateTime endCreationTime            = DateTime.Now;
            AdFormatLeadTypeCollection adFormat = api.GetAdFormatLeads(itemID, status,
                                                                       ncludeMemberMessages, startCreationTime, endCreationTime);

            //check whether the call is success.
            Assert.IsTrue(api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning, "do not success!");
            Assert.IsNotNull(adFormat);
        }
Exemple #2
0
        public void GetAdFormatLeads()
        {
            ItemType itemTest = TestData.NewItem;

            Assert.IsNotNull(itemTest);
            //
            GetAdFormatLeadsCall api = new GetAdFormatLeadsCall(this.apiContext);

            DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] {
                DetailLevelCodeType.ReturnAll
            };
            api.DetailLevelList = new DetailLevelCodeTypeCollection(detailLevels);
            api.ItemID          = itemTest.ItemID;
            // Negative test.
            ApiException gotException = null;

            try
            {
                api.GetAdFormatLeads(api.ItemID);
            }
            catch (ApiException ex)
            {
                gotException = ex;
            }
            Assert.IsNotNull(gotException);
            Assert.AreEqual(gotException.Errors[0].ErrorCode, "580");
        }