protected Tag(BannerTypes bannerType, TagFormats tagFormat, ServingMethods servingMethod, List <string> impressionPixels = null) { BannerType = bannerType; TagFormat = tagFormat; ServingMethod = servingMethod; ImpressionPixels = impressionPixels; }
public void CreateTagWithInvalidSettings() { const BannerTypes bannerType = BannerTypes.Video; const TagFormats tagFormat = TagFormats.JavaScriptDefault; const ServingMethods servingMethod = ServingMethods.Clicks; var ex = Assert.Throws <Exception>(() => TagService.CreateTag(bannerType, tagFormat, servingMethod)); Assert.Equal("This tag format is not valid for this banner type.", ex.Message); }
public static Tag CreateTag(BannerTypes bannerType, TagFormats tagFormat, ServingMethods servingMethod, List <string> impressionPixels = null) { var tag = TagFactory.InitializeTag(bannerType); tag.TagFormat = tagFormat; tag.ServingMethod = servingMethod; tag.ImpressionPixels = impressionPixels; return(tag); }
public CoronaAds() { isActive = false; bannerType = BannerTypes.banner320x48; this.size = new Size(320, 48); location = new Point(0, 0); isTestMode = true; provider = AdsProvider.none; interval = 10; appId = ""; }
public void CreateValidTag() { const BannerTypes bannerType = BannerTypes.Html; const TagFormats tagFormat = TagFormats.Iframe; const ServingMethods servingMethod = ServingMethods.Impressions; var newTag = TagService.CreateTag(bannerType, tagFormat, servingMethod); Assert.Equal(bannerType, newTag.BannerType); Assert.Equal(servingMethod, newTag.ServingMethod); Assert.Equal(tagFormat, newTag.TagFormat); }
public static Tag SetTag(Tag tag, BannerTypes bannerType, TagFormats tagFormat, ServingMethods servingMethod, List <string> impressionPixels = null) { if (tag.BannerType != bannerType) { tag = TagFactory.InitializeTag(bannerType); } tag.TagFormat = tagFormat; tag.ServingMethod = servingMethod; tag.ImpressionPixels = impressionPixels; return(tag); }
public void EditTagWithInvalidSettings() { const BannerTypes bannerType = BannerTypes.Video; const TagFormats tagFormat = TagFormats.UrlToXml; const ServingMethods servingMethod = ServingMethods.Impressions; var videoTag = new Video(BannerTypes.Video, TagFormats.UrlToXml, ServingMethods.Xml); var ex = Assert.Throws <Exception>(() => TagService.SetTag(videoTag, bannerType, tagFormat, servingMethod)); Assert.Equal("This serving method is not valid for this banner type.", ex.Message); }
public void EditValidTagSettings() { const BannerTypes bannerType = BannerTypes.Image; const TagFormats tagFormat = TagFormats.JavaScriptDefault; const ServingMethods servingMethod = ServingMethods.Clicks; var tag = new Image(bannerType, TagFormats.Iframe, ServingMethods.Impressions); var updatedTag = TagService.SetTag(tag, bannerType, tagFormat, servingMethod); Assert.Equal(bannerType, updatedTag.BannerType); Assert.Equal(servingMethod, updatedTag.ServingMethod); Assert.Equal(tagFormat, updatedTag.TagFormat); }
public void EditValidTagType() { const BannerTypes bannerType = BannerTypes.Html; const TagFormats tagFormat = TagFormats.JavaScriptDefault; const ServingMethods servingMethod = ServingMethods.Clicks; var imageTag = new Image(BannerTypes.Image, TagFormats.Iframe, ServingMethods.Impressions); var tag = TagService.SetTag(imageTag, bannerType, tagFormat, servingMethod); Assert.Equal(bannerType, tag.BannerType); Assert.Equal(servingMethod, tag.ServingMethod); Assert.Equal(BannerTypes.Html, BannerTypes.Html); }
public void SetBannerType(BannerTypes bannerType) { switch (bannerType) { case BannerTypes.None: BannerBlock.SetActive(false); break; case BannerTypes.NewCard: BannerBlock.SetActive(true); LanguageManager.Instance.RegisterTextKey(BannerText, "CardBase_NewCardBanner"); break; } }
public static Tag InitializeTag(BannerTypes bannerType) { switch (bannerType) { case BannerTypes.Html: return(new Html(BannerTypes.Html)); case BannerTypes.Image: return(new Image(BannerTypes.Image)); case BannerTypes.Video: return(new Video(BannerTypes.Video)); case BannerTypes.Keyword: return(new Keyword(BannerTypes.Keyword)); default: throw new NotSupportedException("Banner type is not valid."); } }
protected Tag(BannerTypes bannerType) { BannerType = bannerType; }
public Keyword(BannerTypes bannerType, TagFormats tagFormat, ServingMethods servingMethod, List <string> impressionPixels = null) : base(bannerType, tagFormat, servingMethod, impressionPixels) { _impressionPixels = impressionPixels; }
public Keyword(BannerTypes bannerType) : base(bannerType) { }
public Image(BannerTypes bannerType) : base(bannerType) { }
public Video(BannerTypes bannerType) : base(bannerType) { }
public Html(BannerTypes bannerType) : base(bannerType) { }