Exemple #1
0
        private void GetAllAdvertisementsApi(out Campaign addingCampaignThroughApi, List<Advertisement> addingAdvertisements)
        {
            //Adding campaign through api
            addingCampaignThroughApi = Campaign.NextCampaign(RandomData);
            long campaignId = TestHelper.CreateCampaignsApi(addingCampaignThroughApi);
            this.deleteCampaignIds.Add(campaignId);

            //Adding External Type ad through api
            Advertisement externalAdvertisement = new Advertisement();
            externalAdvertisement = Advertisement.NextExternalAdvertisement(RandomData);
            externalAdvertisement.CampaignName = addingCampaignThroughApi.Name;
            TestHelper.CreateAdvertisementsApi(externalAdvertisement);
            addingAdvertisements.Add(externalAdvertisement);

            //Adding Page Like Type ad through api
            Advertisement pageLikeStoryAdvertisement = new Advertisement();
            pageLikeStoryAdvertisement = Advertisement.NextPageLikeStoryAdvertisement(this.RandomData);
            pageLikeStoryAdvertisement.CampaignName = addingCampaignThroughApi.Name;
            TestHelper.CreateSponsorStoryAdvertisementsApi(pageLikeStoryAdvertisement);
            addingAdvertisements.Add(pageLikeStoryAdvertisement);

            #region Debug Post
            ////Adding Page Post Type ad throup api
            //Advertisement pagePostStoryAdvertisement = new Advertisement();
            //pagePostStoryAdvertisement = Advertisement.NextPagePostStoryAdvertisement(this.RandomData);
            //pagePostStoryAdvertisement.CampaignName = addingCampaignThroughApi.Name;
            //TestHelper.CreateSponsorStoryAdvertisementsApi(pagePostStoryAdvertisement);
            //addingAdvertisements.Add(pagePostStoryAdvertisement);
            #endregion

            //Adding Page Post Like Type ad throup api
            Advertisement pagePostLikeStoryAdvertisement = new Advertisement();
            pagePostLikeStoryAdvertisement = Advertisement.NextPagePostLikeStoryAdvertisement(this.RandomData);
            pagePostLikeStoryAdvertisement.CampaignName = addingCampaignThroughApi.Name;
            TestHelper.CreateSponsorStoryAdvertisementsApi(pagePostLikeStoryAdvertisement);
            addingAdvertisements.Add(pagePostLikeStoryAdvertisement);

            //Adding App Used Type ad throup api
            Advertisement appUsedStoryAdvertisement = new Advertisement();
            appUsedStoryAdvertisement = Advertisement.NextAppUsedStoryAdvertisement(this.RandomData);
            appUsedStoryAdvertisement.CampaignName = addingCampaignThroughApi.Name;
            TestHelper.CreateSponsorStoryAdvertisementsApi(appUsedStoryAdvertisement);
            addingAdvertisements.Add(appUsedStoryAdvertisement);

            //Adding App Share Type ad throup api
            Advertisement AppShareStoryAdvertisement = new Advertisement();
            AppShareStoryAdvertisement = Advertisement.NextAppShareStoryAdvertisement(this.RandomData);
            AppShareStoryAdvertisement.CampaignName = addingCampaignThroughApi.Name;
            TestHelper.CreateSponsorStoryAdvertisementsApi(AppShareStoryAdvertisement);
            addingAdvertisements.Add(AppShareStoryAdvertisement);
        }
Exemple #2
0
 public static Campaign Parse(WinRow oneRowInCampaign)
 {
     string runStatusInCell;
     if (oneRowInCampaign.Cells.Count != 21)
     {
         throw new Exception("The count of cell in campaign grid should be equal to 21!");
     }
     if (GridViewUtilities.GetValueProperty(oneRowInCampaign.Cells[3]).Contains("Active"))
     {
         runStatusInCell = GridViewUtilities.GetValueProperty(oneRowInCampaign.Cells[3]).Substring(0, 6);
     }
     else
     {
         runStatusInCell = GridViewUtilities.GetValueProperty(oneRowInCampaign.Cells[3]);
     }
     Campaign campaign = new Campaign
     {
         Name = GridViewUtilities.GetValueProperty(oneRowInCampaign.Cells[2]),
         RunStatus = runStatusInCell,
         Budget = GridViewUtilities.GetValueProperty(oneRowInCampaign.Cells[4]),
         BudgetType = GridViewUtilities.GetValueProperty(oneRowInCampaign.Cells[5]),
         StartTime = GridViewUtilities.GetValueProperty(oneRowInCampaign.Cells[6]),
         StopTime = GridViewUtilities.GetValueProperty(oneRowInCampaign.Cells[7]),
     };
     return campaign;
 }