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 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 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 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 Keyword(BannerTypes bannerType, TagFormats tagFormat, ServingMethods servingMethod, List <string> impressionPixels = null) : base(bannerType, tagFormat, servingMethod, impressionPixels) { _impressionPixels = impressionPixels; }
/// <summary> /// Overrides default serving method /// </summary> /// <param name="methods">the new default serving method for all services</param> /// <param name="override">if true, serving methods for [Service] calsses are overridden with the specified one</param> /// <returns>the modified settings</returns> public InjectionOptions ServingMethod(ServingMethods methods, bool @override = false) { this._servingMethod = methods; this._overrideServingMethod = @override; return(this); }
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); }